Skip to content

Commit

Permalink
Add gitlab CI file
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbousquet committed Jan 20, 2023
1 parent 8fca6cb commit 143f768
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
stages:
- build
- test

## Set environment variables for folders in "cache" job settings for npm modules and Cypress binary
variables:
npm_config_cache: '$CI_PROJECT_DIR/.npm'
CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress'
FF_USE_FASTZIP: 1

cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cache/*
- cache/Cypress
- node_modules
- build

## Install NPM dependencies and Cypress
install:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: build
script:
- npm ci

ui-chrome-tests:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 2
script:
# start the server in the background
- npm run start & npx wait-on http://localhost:4200
# run Cypress tests in parallel
- npx cypress run --parallel --record --browser chrome --group "UI - Chrome"

ui-firefox-tests:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 2
script:
# start the server in the background
- npm run start & npx wait-on http://localhost:4200
# run Cypress tests in parallel
- npx cypress run --parallel --record --browser firefox --group "UI - Firefox"
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"baseUrl": "http://localhost:4200"
"baseUrl": "http://localhost:4200",
"projectId": "hq1hyq"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build-lib": "ng build arlas-wui-lib",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"e2e": "cypress run",
"i18n:init": "ngx-translate-extract --input ./src --output ./src/assets/i18n/template.json --key-as-default-value --replace --format json",
"i18n:extract": "ngx-translate-extract --input ./src --output ./src/assets/i18n/{en,fr}.json --format json",
"cypress:open": "cypress open"
Expand Down

0 comments on commit 143f768

Please sign in to comment.