Skip to content
Snippets Groups Projects

Add tests

Merged Jan Loewe requested to merge feat-jest-tests into master
1 file
+ 1
0
Compare changes
  • Side-by-side
  • Inline
.gitlab-ci.yml 0 → 100644
+ 56
0
image: node:18.15.0
stages:
- test
# === Caches ===
.yarn-cache: &yarn-cache
key: yarn-$CI_JOB_IMAGE
paths:
- .yarn
# === Proxy ===
# Description: sets up the proxy needed for the runner inside of the PTB. Produces a build.env that is used in the next jobs
proxy:
stage: .pre
script:
- touch build.env
- if [[ "$CI_RUNNER_TAGS" == *"behind_proxy"* ]]; then
- echo "behind_proxy=true" >> build.env
- echo "http_proxy=http://webproxy.bs.ptb.de:8080/" >> build.env
- echo "https_proxy=http://webproxy.bs.ptb.de:8080/" >> build.env
- fi
artifacts:
reports:
dotenv: build.env
# === Yarn Install ===
# Description: installs and caches dependencies
.yarn-install: &yarn-install
- corepack enable
# proxy settings
- if [[ "$behind_proxy" == true ]]; then
- npm config set proxy $http_proxy
- npm config set https-proxy $https_proxy
- yarn config set -H httpProxy $http_proxy
- yarn config set -H httpsProxy $https_proxy
- fi
# install deps
- yarn install --immutable
# === Job: Unit Tests ===
# Description: this job runs the unit tests
test:
stage: test
needs: ["proxy"]
script:
- *yarn-install
- yarn run test:unit --ci
cache:
- <<: *yarn-cache
artifacts:
when: always
reports:
junit:
- junit.xml
Loading