chore(31835): update dependencies #3540
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
| name: Frontend - React Testing Pyramid | |
| on: | |
| push: | |
| paths: | |
| - hivemq-edge-frontend/** | |
| - .github/workflows/frontend-cli.yml | |
| - .github/actions/setup_node/action.yml | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| defaults: | |
| run: | |
| working-directory: ./hivemq-edge-frontend/ | |
| # Cancel previous workflow on a follow-up push event | |
| # https://stackoverflow.com/a/72408109 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 👓 Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: 🏗️ Setup node environment | |
| uses: ./.github/actions/setup_node | |
| with: | |
| working-directory: ./hivemq-edge-frontend/ | |
| - name: 🧪 Run Prettier | |
| run: pnpm lint:prettier | |
| - name: 🧪 Run ESLint | |
| run: pnpm lint:eslint | |
| unit_tests: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| vitest-lcov: ${{ steps.vitest-code-coverage.outputs.artifact-id }} | |
| steps: | |
| - name: 👓 Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: 🏗️ Setup node environment | |
| uses: ./.github/actions/setup_node | |
| with: | |
| working-directory: ./hivemq-edge-frontend/ | |
| - name: 🧪 Run Test | |
| run: pnpm test:coverage | |
| - name: 💾 Upload Vitest Code Coverage | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| id: vitest-code-coverage | |
| with: | |
| name: vitest-code-coverage | |
| path: hivemq-edge-frontend/coverage-vitest/lcov.info | |
| if-no-files-found: ignore | |
| retention-days: 1 | |
| build_production: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 👓 Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: 🏗️ Setup node environment | |
| uses: ./.github/actions/setup_node | |
| with: | |
| working-directory: ./hivemq-edge-frontend/ | |
| - name: 🏗️ Build Application | |
| run: pnpm run build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: application | |
| path: ./hivemq-edge-frontend/dist | |
| retention-days: 1 | |
| lighthouse: | |
| runs-on: ubuntu-latest | |
| needs: [ build_production ] | |
| steps: | |
| - name: 👓 Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| name: application | |
| path: ./hivemq-edge-frontend/dist | |
| - name: 🚥 Run Lighthouse audits | |
| uses: treosh/lighthouse-ci-action@2f8dda6cf4de7d73b29853c3f29e73a01e297bd8 # v12 | |
| id: lighthouse | |
| with: | |
| temporaryPublicStorage: true # upload lighthouse report to the temporary storage | |
| ## budgetPath: ./budget.json # test performance budgets | |
| uploadArtifacts: true # save results as an action artifacts | |
| configPath: 'hivemq-edge-frontend/.lighthouserc.cjs' | |
| cypress_matrix: | |
| runs-on: ubuntu-latest | |
| needs: [ build_production ] | |
| strategy: | |
| matrix: | |
| cypress: [ | |
| { component: false, spec: "./cypress/e2e/**/*", lcov_target: "E2E" }, | |
| { component: true, spec: "./src/components/**/*", lcov_target: "Components" }, | |
| { component: true, spec: "./src/extensions/**/*", lcov_target: "Extensions" }, | |
| { component: true, spec: "./src/modules/!(Workspace)**/*", lcov_target: "Modules" }, | |
| { component: true, spec: "./src/modules/Workspace/**/*", lcov_target: "Workspace" } | |
| ] | |
| name: Cypress - ${{ matrix.cypress.lcov_target }} | |
| steps: | |
| - name: 👓 Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: 🏗️ Setup node environment | |
| uses: ./.github/actions/setup_node | |
| with: | |
| working-directory: ./hivemq-edge-frontend/ | |
| run-install: true | |
| - name: Download artifact | |
| uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 | |
| with: | |
| name: application | |
| path: ./hivemq-edge-frontend/dist | |
| - name: 🧪 Run Cypress suite | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| component: ${{ matrix.cypress.component }} | |
| spec: ${{ matrix.cypress.spec }} | |
| start: pnpm preview --port 3000 | |
| working-directory: ./hivemq-edge-frontend/ | |
| quiet: true | |
| # after the test, store videos | |
| - name: 💾 Upload Cypress - ${{ matrix.cypress.lcov_target }} videos | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: cypress-${{ matrix.cypress.lcov_target }}-videos | |
| path: hivemq-edge-frontend/cypress/videos | |
| if-no-files-found: ignore | |
| retention-days: 1 | |
| - name: 💾 Upload Cypress Code Coverage | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: vitest-code-coverage | |
| path: hivemq-edge-frontend/coverage-cypress/lcov.info | |
| if-no-files-found: ignore | |
| retention-days: 1 | |
| combine_code_coverage: | |
| runs-on: ubuntu-latest | |
| needs: [ cypress_matrix, unit_tests ] | |
| if: success() || failure() | |
| steps: | |
| - env: | |
| VITEST: ${{needs.unit_tests.outputs.vitest-lcov}} | |
| run: echo "Artifact ID from previous job is $VITEST" |