Files
akvorado/.gitlab-ci.yml
Vincent Bernat fce383dbf4 build: switch to pnpm
It should be a bit more secure to not install scripts by default and to
allow one to update dependencies with a delay. Also, it is faster. The
downside is that it is not usually shipped with npm, but we can download
it through corepack (which is shipped with node). It also has more
builtin features, including patching packages (but we don't need that
anymore).
2025-09-18 07:31:45 +02:00

50 lines
1.4 KiB
YAML

---
stages:
- tests
- build
run tests:
stage: tests
image: golang:alpine
cache:
- key:
files:
- go.sum
paths:
- .go-cache/
- key:
files:
- console/frontend/pnpm-lock.yaml
paths:
- .pnpm-store
script:
# Tests on GitLab do not include functional tests. This was the case in the
# past but this is a slight burden to maintain in addition to GitHub CI.
# Check commit ceaa6ebf8ef6 for the last version supporting functional
# tests.
- time apk add --no-cache git make gcc musl-dev shared-mime-info pnpm curl zip
- export GOMODCACHE=$PWD/.go-cache
- pnpm config set store-dir .pnpm-store
- time go mod download
- time make && ./bin/akvorado version
- time make test-race
- time make test-js
- time make test-coverage
coverage: '/Code coverage: [0-9.]+/'
# Coverage reports were removed
# To execute manually:
# gitlab-runner exec docker "run tests"
build docker image:
stage: build
image: docker:stable
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_ID
script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -f docker/Dockerfile -t $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID