Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Gh actions for cypress test #2900

Closed
wants to merge 10 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/cypress-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ on:
required: true

jobs:
test:
name: Cypress-tester
cypress-run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
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"
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
Loading