diff --git a/.github/workflows/cypress-tester.yml b/.github/workflows/cypress-tester.yml index a5af102e2..9f24ae405 100644 --- a/.github/workflows/cypress-tester.yml +++ b/.github/workflows/cypress-tester.yml @@ -7,8 +7,7 @@ on: required: true jobs: - test: - name: Cypress-tester + cypress-run: runs-on: ubuntu-latest strategy: fail-fast: false @@ -16,9 +15,16 @@ jobs: ci_index: [0, 1, 2, 3] ci_total: [4] steps: - - name: Hente kode + - name: Checkout repo uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.x + registry-url: https://npm.pkg.github.com/ + scope: '@navikt' + - name: Setup .yarnrc.yml run: | yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com" @@ -27,21 +33,21 @@ jobs: env: NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Sette opp Node - uses: actions/setup-node@v4 + - name: Cache Yarn dependencies + id: yarn-cache + uses: actions/cache@v3 with: - node-version: 18.x - registry-url: https://npm.pkg.github.com/ - scope: '@navikt' + path: .yarn/cache + key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn-${{ runner.os }}- - - name: Installere moduler - run: yarn install --immutable + - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --immutable --mode=skip-build env: NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Installere Cypress - run: npx cypress install - - name: Start E2E-server uses: cypress-io/github-action@v6 env: @@ -52,7 +58,7 @@ jobs: wait-on-timeout: 60 runTests: false - - name: Kjør Cypress tester + - name: Run Cypress tests run: node split.mjs | xargs yarn cypress run --spec env: CI_TOTAL: ${{ matrix.ci_total }}