From 6da6c8a3bba8fa94707e56d7e4db9624d9c78790 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Fri, 10 May 2024 12:45:43 +0200 Subject: [PATCH] chore: update actions images --- .github/actions/cypress-cache/action.yaml | 2 +- .github/actions/lint/action.yaml | 2 +- .github/actions/node-cache/action.yaml | 2 +- .github/actions/release/action.yaml | 4 ++-- .github/actions/test-e2e/action.yaml | 8 +++++++- .github/actions/test-unit/action.yaml | 2 +- .github/actions/webpack-cache/action.yaml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- e2e-script.js | 9 ++++++++- .../src/e2e/test-app/module-loading-errors.cy.ts | 2 +- examples/test-app/src/entry.tsx | 6 +++--- 11 files changed, 34 insertions(+), 21 deletions(-) diff --git a/.github/actions/cypress-cache/action.yaml b/.github/actions/cypress-cache/action.yaml index f191b78..9672ae7 100644 --- a/.github/actions/cypress-cache/action.yaml +++ b/.github/actions/cypress-cache/action.yaml @@ -4,7 +4,7 @@ runs: using: "composite" steps: # cache cypress runner - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cypress-cache with: path: /home/runner/.cache/Cypress diff --git a/.github/actions/lint/action.yaml b/.github/actions/lint/action.yaml index 12f9be3..0d62e65 100644 --- a/.github/actions/lint/action.yaml +++ b/.github/actions/lint/action.yaml @@ -3,7 +3,7 @@ description: verify linting rules runs: using: "composite" steps: - - uses: nrwl/nx-set-shas@v3 + - uses: nrwl/nx-set-shas@v4 - uses: './.github/actions/node-cache' - name: Install deps shell: bash diff --git a/.github/actions/node-cache/action.yaml b/.github/actions/node-cache/action.yaml index e312397..3a49e90 100644 --- a/.github/actions/node-cache/action.yaml +++ b/.github/actions/node-cache/action.yaml @@ -4,7 +4,7 @@ runs: using: "composite" steps: # cache node modules for all jobs to use - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: node_modules-cache with: path: | diff --git a/.github/actions/release/action.yaml b/.github/actions/release/action.yaml index 10c96f5..99043fa 100644 --- a/.github/actions/release/action.yaml +++ b/.github/actions/release/action.yaml @@ -17,9 +17,9 @@ runs: using: "composite" steps: - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - uses: './.github/actions/node-cache' - name: Install deps shell: bash diff --git a/.github/actions/test-e2e/action.yaml b/.github/actions/test-e2e/action.yaml index 7250d9f..f67e15c 100644 --- a/.github/actions/test-e2e/action.yaml +++ b/.github/actions/test-e2e/action.yaml @@ -3,7 +3,7 @@ description: verify e2e tests runs: using: "composite" steps: - - uses: nrwl/nx-set-shas@v3 + - uses: nrwl/nx-set-shas@v4 - uses: './.github/actions/node-cache' - uses: './.github/actions/cypress-cache' - uses: './.github/actions/webpack-cache' @@ -13,4 +13,10 @@ runs: - name: Run e2e tests shell: bash run: npm run test:e2e + - name: Upload test results + uses: actions/upload-artifact@v4 + if: failure() + with: + name: test-results + path: dist/cypress/examples/test-app-e2e/screenshots/ diff --git a/.github/actions/test-unit/action.yaml b/.github/actions/test-unit/action.yaml index f410882..dea40f6 100644 --- a/.github/actions/test-unit/action.yaml +++ b/.github/actions/test-unit/action.yaml @@ -3,7 +3,7 @@ description: verify unit tests runs: using: "composite" steps: - - uses: nrwl/nx-set-shas@v3 + - uses: nrwl/nx-set-shas@v4 - uses: './.github/actions/node-cache' - name: Install deps shell: bash diff --git a/.github/actions/webpack-cache/action.yaml b/.github/actions/webpack-cache/action.yaml index a42ef45..8764357 100644 --- a/.github/actions/webpack-cache/action.yaml +++ b/.github/actions/webpack-cache/action.yaml @@ -4,7 +4,7 @@ runs: using: "composite" steps: # cache node modules for all jobs to use - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: webpack-cache with: path: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f445753..ede61ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,10 @@ jobs: install: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: nrwl/nx-set-shas@v3 + - uses: nrwl/nx-set-shas@v4 # cache node modules for all jobs to use - uses: './.github/actions/node-cache' # cache cypress runner @@ -24,7 +24,7 @@ jobs: needs: [install] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: './.github/actions/lint' @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest needs: [install] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: './.github/actions/test-unit' @@ -40,10 +40,10 @@ jobs: runs-on: ubuntu-latest needs: [install] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: nrwl/nx-set-shas@v3 + - uses: nrwl/nx-set-shas@v4 - uses: './.github/actions/node-cache' - name: Install deps run: npm i @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest needs: [install, build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: './.github/actions/test-e2e' @@ -62,7 +62,7 @@ jobs: needs: [install, lint, test, build, test-e2e] if: github.event_name != 'pull_request' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 ssh-key: ${{ secrets.BOTH_AUTH_KEY }} diff --git a/e2e-script.js b/e2e-script.js index 4458945..49e2050 100644 --- a/e2e-script.js +++ b/e2e-script.js @@ -16,6 +16,13 @@ try { // ensure the deps exist before we start the servers execSync('npm run build', { cwd: cdnPath, stdio: 'inherit'}) +console.log('Dist dir of assets:') +execSync('ls -la dist', { cwd: cdnPath, stdio: 'inherit'}) +console.log('Root dir of assets:') +execSync('ls -la .', { cwd: cdnPath, stdio: 'inherit'}) +console.log('Root dir:') +execSync('ls -la', { cwd: __dirname, stdio: 'inherit'}) + const {result, commands} = concurrently( [{ name: 'cdn-server', @@ -29,7 +36,7 @@ const {result, commands} = concurrently( }, { cwd: __dirname, name: 'e2e', - command: 'npx wait-on federation-cdn-mock/dist http://localhost:4200 http://localhost:8001 -i 2000 && npx nx run test-app-e2e:e2e --skipNxCache', + command: 'npx wait-on http://localhost:4200 http://127.0.0.1:8001 && npx nx run test-app-e2e:e2e --skipNxCache', }], { successCondition: 'e2e', diff --git a/examples/test-app-e2e/src/e2e/test-app/module-loading-errors.cy.ts b/examples/test-app-e2e/src/e2e/test-app/module-loading-errors.cy.ts index 07d4f54..742039d 100644 --- a/examples/test-app-e2e/src/e2e/test-app/module-loading-errors.cy.ts +++ b/examples/test-app-e2e/src/e2e/test-app/module-loading-errors.cy.ts @@ -3,7 +3,7 @@ describe('Module error loading handling', () => { cy.visit('http://localhost:4200/legacy'); // intercept webpack chunk and return 500 response - cy.intercept('GET', 'http://localhost:8001/exposed-./PreLoadedModule.js', { + cy.intercept('GET', 'http://127.0.0.1:8001/exposed-./PreLoadedModule.js', { statusCode: 500, }); diff --git a/examples/test-app/src/entry.tsx b/examples/test-app/src/entry.tsx index 2e3acaf..f0ee4a6 100644 --- a/examples/test-app/src/entry.tsx +++ b/examples/test-app/src/entry.tsx @@ -14,12 +14,12 @@ const config: AppsConfig<{ assetsHost?: string }> = { notFound: { name: 'notFound', manifestLocation: '/assets/testPath/foo/bar/nonsense.json', - assetsHost: 'http://localhost:8888', + assetsHost: 'http://127.0.0.1:8001', }, 'sdk-plugin': { name: 'sdk-plugin', - assetsHost: 'http://localhost:8001', - manifestLocation: 'http://localhost:8001/plugin-manifest.json', + assetsHost: 'http://127.0.0.1:8001', + manifestLocation: 'http://127.0.0.1:8001/plugin-manifest.json', }, };