Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oving8-GitLab-CI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Magnar Dybwad Dæhli
oving8-GitLab-CI
Commits
735077a9
Commit
735077a9
authored
3 years ago
by
Magnar Dæhli
Browse files
Options
Downloads
Patches
Plain Diff
added code from lecture
parent
be7b9b96
No related branches found
No related tags found
1 merge request
!1
Master
Pipeline
#182903
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+7
-56
7 additions, 56 deletions
.gitlab-ci.yml
with
7 additions
and
56 deletions
.gitlab-ci.yml
+
7
−
56
View file @
735077a9
stages
:
-
build
-
test
# to cache both npm modules and Cypress binary we use environment variables
# to point at the folders we can list as paths in "cache" job settings
variables
:
npm_config_cache
:
"
$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER
:
"
$CI_PROJECT_DIR/cache/Cypress"
# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
.npm
-
cache/Cypress
-
node_modules
test
:
image
:
node:latest
image
:
cypress/base:10
stage
:
test
script
:
# install dependencies
-
npm ci
# start the server in the background
-
npm run start &
# run Cypress tests
-
npm run e2e
# added artifacts
# this job installs NPM dependencies and Cypress
install
:
image
:
cypress/base:10
stage
:
build
script
:
-
npm ci
# check Cypress binary path and cached versions
# useful to make sure we are not carrying around old versions
-
npx cypress cache path
-
npx cypress cache list
-
$(npm bin)/print-env CI
-
npm run cy:verify
-
npm run cy:info
# all jobs that actually run tests can use the same definition
.job_template
:
image
:
cypress/base:10
stage
:
test
script
:
# print CI environment variables for reference
-
$(npm bin)/print-env CI
# start the server in the background
-
npm run start &
# run Cypress test in load balancing mode
-
npm run e2e:record -- --parallel --group "electrons on GitLab CI"
# Kjør express-serveren i bakgrunnen
-
npm start &
# Kjør testene
-
npm test
artifacts
:
when
:
always
paths
:
-
cypress/videos
/**/*.mp4
-
cypress/screenshots
/**/*.png
-
cypress/videos
-
cypress/screenshots
expire_in
:
1 day
# actual job definitions
# all steps are the same, they come from the template above
electrons-1
:
extends
:
.job_template
electrons-2
:
extends
:
.job_template
electrons-3
:
extends
:
.job_template
electrons-4
:
extends
:
.job_template
electrons-5
:
extends
:
.job_template
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment