From a5a6363b90625967ca89b9896867ef352a0cbecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radu-Mihai=20Pa=C8=99parug=C4=83?= Date: Mon, 16 Sep 2024 02:06:01 +0300 Subject: [PATCH 1/2] chore: change workflow --- .github/workflows/main.yml | 234 +++---------------------------------- 1 file changed, 14 insertions(+), 220 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93106f750..abbcef9c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,226 +1,20 @@ -name: Cypress Tests - -on: - push: - branches-ignore: - - "renovate/**" - +name: Workflow for Codecov example-javascript +on: [push, pull_request] jobs: - install: + run: runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1 - options: --user 1001 steps: - name: Checkout uses: actions/checkout@v4 - - - name: Cypress install - uses: cypress-io/github-action@v6 - with: - runTests: false - # report machine parameters - - run: yarn cypress info - - run: node --version - - run: node -p 'os.cpus()' - - run: yarn types - - run: yarn lint - - run: yarn test:unit:ci - - run: yarn build:ci - - - name: Save build folder - uses: actions/upload-artifact@v4 - with: - name: build - if-no-files-found: error - path: build - - ui-chrome-tests: - timeout-minutes: 15 - runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1 - options: --user 1001 - needs: install - strategy: - # when one test fails, DO NOT cancel the other - # containers, because this will kill Cypress processes - # leaving Cypress Cloud hanging ... - # https://github.com/cypress-io/github-action/issues/48 - fail-fast: false - matrix: - # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download the build folders - uses: actions/download-artifact@v4 - with: - name: build - path: build - - - name: Node info - run: node -v - - - name: __e Dir - run: ls /__e - - - name: "UI Tests - Chrome" - uses: cypress-io/github-action@v6 - with: - build: yarn cypress info - start: yarn start:ci - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - browser: chrome - record: true - parallel: true - group: "UI - Chrome" - spec: cypress/tests/ui/* - config-file: cypress.config.ts - env: - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DEBUG: "cypress:server:args" - - ui-chrome-mobile-tests: - timeout-minutes: 15 - runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1 - options: --user 1001 - needs: install - strategy: - # when one test fails, DO NOT cancel the other - # containers, because this will kill Cypress processes - # leaving Cypress Cloud hanging ... - # https://github.com/cypress-io/github-action/issues/48 - fail-fast: false - matrix: - # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download the build folders - uses: actions/download-artifact@v4 - with: - name: build - path: build - - - name: "UI Tests - Chrome - Mobile" - uses: cypress-io/github-action@v6 - with: - config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}' - start: yarn start:ci - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - browser: chrome - record: true - parallel: true - group: "UI - Chrome - Mobile" - spec: cypress/tests/ui/* - config-file: cypress.config.ts - env: - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - ui-firefox-tests: - timeout-minutes: 15 - runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1 - options: --user 1001 - needs: install - strategy: - # when one test fails, DO NOT cancel the other - # containers, because this will kill Cypress processes - # leaving Cypress Cloud hanging ... - # https://github.com/cypress-io/github-action/issues/48 - fail-fast: false - matrix: - # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download the build folders - uses: actions/download-artifact@v4 - with: - name: build - path: build - - - name: "UI Tests - Firefox" - uses: cypress-io/github-action@v6 - with: - start: yarn start:ci - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - browser: firefox - record: true - parallel: true - group: "UI - Firefox" - spec: cypress/tests/ui/* - config-file: cypress.config.ts - env: - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - ui-firefox-mobile-tests: - timeout-minutes: 15 - runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1 - options: --user 1001 - needs: install - strategy: - # when one test fails, DO NOT cancel the other - # containers, because this will kill Cypress processes - # leaving Cypress Cloud hanging ... - # https://github.com/cypress-io/github-action/issues/48 - fail-fast: false - matrix: - # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download the build folders - uses: actions/download-artifact@v4 - with: - name: build - path: build - - - name: "UI Tests - Firefox - Mobile" - uses: cypress-io/github-action@v6 - with: - config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}' - start: yarn start:ci - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - browser: firefox - record: true - parallel: true - group: "UI - Firefox - Mobile" - spec: cypress/tests/ui/* - config-file: cypress.config.ts + - name: Set up Node 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: yarn + - name: Run tests and collect coverage + run: npm run test:unit:ci + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 env: - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} \ No newline at end of file From 936e1b1877cbc6ee7d54fb21d4776c61a54e9499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radu-Mihai=20Pa=C8=99parug=C4=83?= Date: Mon, 16 Sep 2024 02:07:57 +0300 Subject: [PATCH 2/2] fix: update token name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abbcef9c4..8733ac2d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,4 +17,4 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file