From 822674e2cb83c30249d409c630e3188ac6cce4aa Mon Sep 17 00:00:00 2001 From: Alan Greasley Date: Wed, 27 Nov 2024 15:04:20 +0000 Subject: [PATCH] chore: ci limits on building finsemble, and clean up --- .github/workflows/branch.yml | 17 +++++++++++++ .github/workflows/e2e-full.yml | 37 ++++------------------------- .github/workflows/e2e-smoke.yml | 2 +- .github/workflows/pull-fork.yml | 42 --------------------------------- .github/workflows/pull.yml | 22 +++-------------- .github/workflows/tag.yml | 7 ------ packages/client/README.md | 5 ++-- packages/client/package.json | 9 +++---- 8 files changed, 32 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/pull-fork.yml diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index ac966bff9..fcbc8c7c7 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -51,9 +51,24 @@ jobs: with: project_id: ${{ secrets.GOOGLE_PROJECT_ID }} + - name: Restore cache + uses: actions/cache/restore@v4 + id: cache-npm + with: + path: packages/client/node_modules + key: ${{ runner.OS }}-node-${{ hashFiles('packages/client/package-lock.json') }} + - name: Install dependencies + if: steps.cache-npm.outputs.cache-hit != 'true' run: npm ci + - name: Cache node modules + if: steps.cache-npm.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: packages/client/node_modules + key: ${{ runner.OS }}-node-${{ hashFiles('packages/client/package-lock.json') }} + - name: Verify Quality (type checking, linting, format checking, tests) run: npm run verify @@ -90,6 +105,7 @@ jobs: gs://$BUCKET_OPENFIN/branch/${{ steps.vars.outputs.BRANCH }} - name: Build (Finsemble) + if: ${{ steps.vars.outputs.ENVIRONMENT == 'dev' || steps.vars.outputs.ENVIRONMENT == 'uat' }} env: DOMAIN: https://finsemble.${{ steps.vars.outputs.ENVIRONMENT }}.reactivetrader.com URL_PATH: ${{ steps.vars.outputs.URL_SUFFIX }} @@ -98,6 +114,7 @@ jobs: run: npm run finsemble:build - name: Deploy (Finsemble) + if: ${{ steps.vars.outputs.ENVIRONMENT == 'dev' || steps.vars.outputs.ENVIRONMENT == 'uat' }} run: | gsutil -m \ -h "Cache-Control: no-cache" \ diff --git a/.github/workflows/e2e-full.yml b/.github/workflows/e2e-full.yml index ed23bd69e..2def03f47 100644 --- a/.github/workflows/e2e-full.yml +++ b/.github/workflows/e2e-full.yml @@ -2,7 +2,7 @@ name: Reactive Trader Dev Weekday E2E on: schedule: - - cron: "00 8,10,12,14,16 * * 1-5" + - cron: "45 8 * * 1-5" defaults: run: @@ -28,44 +28,15 @@ jobs: - name: Install dependencies run: npm ci - - name: Test Dev + - name: Test env: E2E_RTC_WEB_ROOT_URL: https://web.dev.reactivetrader.com - run: npx playwright test --project=web credit.spec.ts - continue-on-error: true + run: npm run e2e:web - name: Artifact Upload uses: actions/upload-artifact@v4 if: failure() with: - name: playwright-report-dev - path: packages/client/playwright-report/ - retention-days: 7 - - - name: Test UAT - env: - E2E_RTC_WEB_ROOT_URL: https://web.uat.reactivetrader.com - run: npx playwright test --project=web credit.spec.ts - continue-on-error: true - - - name: Artifact Upload - uses: actions/upload-artifact@v4 - if: failure() - with: - name: playwright-report-uat - path: packages/client/playwright-report/ - retention-days: 7 - - - name: Test Prod - env: - E2E_RTC_WEB_ROOT_URL: https://web.prod.reactivetrader.com - run: npx playwright test --project=web credit.spec.ts - continue-on-error: true - - - name: Artifact Upload - uses: actions/upload-artifact@v4 - if: failure() - with: - name: playwright-report-prod + name: playwright-report path: packages/client/playwright-report/ retention-days: 7 diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml index 7b7f0338c..74d00f9c9 100644 --- a/.github/workflows/e2e-smoke.yml +++ b/.github/workflows/e2e-smoke.yml @@ -2,7 +2,7 @@ name: Reactive Trader Prod Daily E2E on: schedule: - - cron: "55 8 * * *" + - cron: "30 8 * * 1-5" defaults: run: diff --git a/.github/workflows/pull-fork.yml b/.github/workflows/pull-fork.yml deleted file mode 100644 index bd7944181..000000000 --- a/.github/workflows/pull-fork.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Fork Pull Request - -on: - pull_request: - types: - - opened - - synchronize - -defaults: - run: - working-directory: packages/client - -jobs: - build: - name: Build - - runs-on: ubuntu-20.04 - - if: ${{ github.event.pull_request.head.repo.fork }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set Node version - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install dependencies - run: npm ci - - - name: Verify Quality (type checking, linting, format checking, tests) - run: npm run verify - - - name: Build (web) - run: | - npm run build - npm run storybook:build - - - name: Build (OpenFin) - run: npm run openfin:build diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 61f037c5d..46c5c337d 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -15,7 +15,6 @@ defaults: env: BUCKET_WEB: reactive-trader-web-builds BUCKET_OPENFIN: reactive-trader-openfin-builds - BUCKET_FINSEMBLE: reactive-trader-finsemble-builds ENVIRONMENT: env jobs: @@ -80,20 +79,6 @@ jobs: rsync -d -r dist \ gs://$BUCKET_OPENFIN/pull/${{ github.event.number }} - - name: Build (Finsemble) - env: - DOMAIN: https://finsemble.env.reactivetrader.com - URL_PATH: /pull/${{ github.event.number }} - VITE_BUILD_VERSION: ${{ github.sha }} - run: npm run finsemble:build - - - name: Deploy (Finsemble) - run: | - gsutil -m \ - -h "Cache-Control: no-cache" \ - rsync -d -r dist \ - gs://$BUCKET_FINSEMBLE/pull/${{ github.event.number }} - - name: Find comment uses: peter-evans/find-comment@v3 id: comment @@ -120,7 +105,6 @@ jobs: | OpenFin - Credit | fins://openfin.env.reactivetrader.com/pull/${{ github.event.number }}/config/rt-credit.json | | OpenFin - Launcher | fins://openfin.env.reactivetrader.com/pull/${{ github.event.number }}/config/launcher.json | | OpenFin - Workspace | fins://openfin.env.reactivetrader.com/pull/${{ github.event.number }}/workspace/config/workspace.json | - | Finsemble | https://finsemble.env.reactivetrader.com/pull/${{ github.event.number }} | ### Performance @@ -156,7 +140,7 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: playwright-report + name: playwright-report-web path: packages/client/playwright-report/ retention-days: 7 @@ -191,7 +175,7 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: playwright-report + name: playwright-report-of-fx path: packages/client/playwright-report/ retention-days: 7 @@ -226,6 +210,6 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: playwright-report + name: playwright-report-of-credit path: packages/client/playwright-report/ retention-days: 7 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 776bf932a..e65248c1f 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -83,13 +83,6 @@ jobs: rsync -d -r dist \ gs://$BUCKET_OPENFIN/tag/${{ steps.vars.outputs.TAG }} - - name: Deploy (Launcher) - run: | - gsutil -m \ - -h "Cache-Control: no-cache" \ - rsync -d -r dist \ - gs://$BUCKET_LAUNCHER/tag/${{ steps.vars.outputs.TAG }} - - name: Build (Finsemble) env: DOMAIN: https://finsemble.prod.reactivetrader.com diff --git a/packages/client/README.md b/packages/client/README.md index 5e86c5578..b292f5431 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -169,12 +169,12 @@ Working with OpenFin workspace locally using the OpenFin CLI ... `npm run openfin:dev` as above to serve RT apps, views and the workspace platform -`npm run workspace:run` to launch workspace (when running local dev server, you'll see the "provider" window first) +`npm run openfin:run:workspace` to launch workspace (when running local dev server, you'll see the "provider" window first) As a shortcut, to run the local dev server and client in one command, use ```sh -npm run workspace:start +npm run openfin:start:workspace ``` #### Configs @@ -262,7 +262,6 @@ npm run openfin:start:launcher ``` and launch all of the apps from the launcher -(RA E2E tests need to be run from the RA repo) ```sh npm run e2e:openfin -- --workers=1 diff --git a/packages/client/package.json b/packages/client/package.json index ddc0a1888..6a6d90645 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -38,6 +38,7 @@ "start": "vite", "build": "vite build", "serve": "vite preview", + "preview": "vite preview", "openfin:dev": "cross-env TARGET=openfin vite", "openfin:local": "npm run _runLocal --runcmd=\"TARGET=openfin vite\"", "_openfin:run": "cross-env-shell \"wait-on -l $npm_config_manifest_url && openfin -l -c $npm_config_manifest_url\"", @@ -45,6 +46,7 @@ "openfin:run:credit": "npm run _openfin:run --manifest_url=http://localhost:1917/config/rt-credit.json", "openfin:run:limitchecker": "npm run _openfin:run --manifest_url=http://localhost:1917/config/limit-checker.json", "openfin:run:launcher": "npm run _openfin:run --manifest_url=http://localhost:1917/config/launcher.json", + "openfin:run:workspace": "npm run _openfin:run --manifest_url=http://localhost:1917/workspace/config/workspace.json", "openfin:start:fx": "concurrently \"npm:openfin:dev\" \"npm:openfin:run:fx\"", "openfin:start:fx:local": "concurrently \"npm:openfin:local\" \"npm:openfin:run:fx\"", "openfin:start:credit": "concurrently \"npm:openfin:dev\" \"npm:openfin:run:credit\"", @@ -52,11 +54,10 @@ "openfin:start:limitchecker": "concurrently \"npm:openfin:dev\" \"npm:openfin:run:limitchecker\"", "openfin:start:launcher": "concurrently \"npm:openfin:dev\" \"npm:openfin:run:launcher\"", "openfin:start:launcher:local": "concurrently \"npm:openfin:local\" \"npm:openfin:run:launcher\"", + "openfin:start:workspace": "concurrently \"npm:openfin:dev\" \"npm:workspace:run\"", "openfin:build": "cross-env TARGET=openfin vite build", - "openfin:start:preview": "npm:openfin:build && concurrently \"npm:serve\" \"npm:openfin:run:launcher\"", - "workspace:run": "npm run _openfin:run --manifest_url=http://localhost:1917/workspace/config/workspace.json", - "workspace:start": "concurrently \"npm:openfin:dev\" \"npm:workspace:run\"", - "workspace:start:preview": "npm:openfin:build && concurrently \"npm:serve\" \"npm:workspace:run\"", + "openfin:preview:launcher": "npm:openfin:build && concurrently \"npm:serve\" \"npm:openfin:run:launcher\"", + "openfin:preview:workspace": "npm:openfin:build && concurrently \"npm:serve\" \"npm:workspace:run\"", "finsemble:dev": "cross-env TARGET=finsemble vite", "finsemble:build": "cross-env TARGET=finsemble vite build", "storybook": "storybook dev -p 6006",