Skip to content

Commit

Permalink
Fix CI and resolve linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paustint committed Feb 3, 2025
1 parent 16928b0 commit d3db6f8
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 47 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:

env:
NODE_OPTIONS: '--max_old_space_size=4096'
LOG_LEVEL: warn
CONTENTFUL_HOST: cdn.contentful.com
CONTENTFUL_SPACE: wuv9tl5d77ll
Expand All @@ -21,8 +22,46 @@ jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
name: Checkout [master]
with:
fetch-depth: 0

- name: Setup branch tracking
if: success() && github.ref != 'refs/heads/main'
run: git branch --track main origin/main

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: install dependencies
run: yarn install --frozen-lockfile

- name: Test all projects
run: yarn test:all

- name: Build
run: yarn build:ci

- name: Uploading artifacts
uses: actions/upload-artifact@v4
with:
name: dist-artifacts
path: dist

test-cron:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PRISMA_TEST_DB_URI: postgres://postgres:postgres@localhost:5432/postgres
JETSTREAM_POSTGRES_DBURI: postgres://postgres:postgres@localhost:5432/postgres

services:
postgres:
Expand All @@ -45,13 +84,6 @@ jobs:
with:
fetch-depth: 0

- name: Setup branch tracking
if: success() && github.ref != 'refs/heads/main'
run: git branch --track main origin/main

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
Expand All @@ -67,25 +99,10 @@ jobs:
- name: Run database migration
run: yarn db:migrate

- name: Test all affected projects
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: yarn test:all

- name: Build
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: yarn build:ci
- name: Test cron-tasks
run: yarn test:cron

- name: Uploading artifacts
uses: actions/upload-artifact@v4
with:
name: dist-artifacts
path: dist

# e2e tests only runs if build passes, since it uses production build to run tests
e2e:
needs: build-and-test
runs-on: ubuntu-latest
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: false
Expand Down Expand Up @@ -141,11 +158,8 @@ jobs:
- name: install dependencies
run: yarn install --frozen-lockfile

- name: Download artifacts from build
uses: actions/download-artifact@v4
with:
name: dist-artifacts
path: dist
- name: Build
run: yarn build:ci

- name: Install Playwright dependencies
run: npx playwright install --with-deps
Expand Down
1 change: 0 additions & 1 deletion apps/jetstream-web-extension/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
export default {
displayName: 'jetstream-web-extension',
preset: '../../jest.preset.js',
Expand Down
10 changes: 0 additions & 10 deletions apps/jetstream-web-extension/src/contentScriptAuth.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-globals */
import { enableLogger } from '@jetstream/shared/client-logger';
import '@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css';
import localforage from 'localforage';
Expand Down
2 changes: 1 addition & 1 deletion apps/jetstream-web-extension/src/serviceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ chrome.tabs.onActivated.addListener(async (info) => {
});

chrome.storage.onChanged.addListener((changes, namespace) => {
for (const [key, { oldValue, newValue }] of Object.entries(changes)) {
for (const [key, { newValue }] of Object.entries(changes)) {
switch (namespace) {
case 'sync': {
if (storageTypes.authTokens.key === key) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-globals */
/**
* This file is based on the Salesforce Inspector extension for Chrome. (MIT license)
* Credit: https://github.com/sorenkrabbe/Chrome-Salesforce-inspector/blob/master/addon/background.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/rules-of-hooks */
/**
* All code was copied from https://github.com/eliihen/localforage-webExtensionStorage-driver?tab=readme-ov-file
* MIT licensed
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"start:prod": "NODE_ENV=production node dist/apps/api/main.js",
"start:staging": "NODE_ENV=production node dist/apps/api/main.js",
"start:e2e": "node dist/apps/api/main.js",
"start:web-extension": "nx run jetstream-web-extension:serve",
"start:cron:save-analytics-summary": "node dist/apps/cron-tasks/save-analytics-summary.js",
"start:cron:geo-ip-api-updater": "node dist/apps/cron-tasks/geo-ip-api-updater.js",
"build": "cross-env NODE_ENV=production npm-run-all db:generate build:core build:landing generate:version",
Expand Down Expand Up @@ -83,9 +82,10 @@
"icons:build:utility": "npx @svgr/[email protected] --config-file .svgo-config.json -d ./libs/icon-factory/src/lib/icons/utility ./node_modules/@salesforce-ux/design-system/assets/icons/utility",
"test": "nx test",
"test:affected": "TZ=UTC nx affected -t test --output-style=stream",
"test:all": "TZ=UTC nx run-many -t test --output-style=stream --skip-nx-cache",
"test:cron:e2e": "yarn build:cron && cd dist/apps/cron-tasks && docker-compose -f docker-compose.e2e.yml up --build",
"lint": "nx workspace-lint && nx lint",
"test:all": "TZ=UTC nx run-many -t test --exclude cron-tasks --output-style=stream --skip-nx-cache",
"test:cron": "TZ=UTC nx run-many -t test -p cron-tasks --output-style=stream --skip-nx-cache",
"lint:affected": "TZ=UTC nx affected -t lint --output-style=stream",
"lint:all": "TZ=UTC nx run-many -t lint --output-style=stream --skip-nx-cache",
"e2e": "nx e2e",
"playwright:open": "yarn playwright open http://localhost:3333",
"playwright:test:with-server": "yarn start-server-and-test --expect 200 'yarn start:e2e' http://localhost:3333 'yarn playwright:test'",
Expand Down

0 comments on commit d3db6f8

Please sign in to comment.