condorcore-keyring/.gitlab-ci.yml
David Runge 5e6a8a2e98
gitlab-ci: Run lint, build and install
.gitlab-ci.yml:
Add rule to run `make lint` if `keyringctl` changes in a merge request.
Add integration stage to always attempt to build and install the keyring
in a containerized environment.
2021-11-30 22:54:08 +01:00

59 lines
1.3 KiB
YAML

---
image: archlinux:latest
stages:
- lint
- integration
variables:
PACMAN_CACHE: "${CI_PROJECT_DIR}/.pacman/pkg"
cache:
paths:
- .pacman/pkg
key: ${CI_JOB_NAME}
check-new-key:
stage: lint
needs: []
script:
- install -d "${PACMAN_CACHE}"
- pacman -Syu --needed --noconfirm --cachedir "${PACMAN_CACHE}" git grep hopenpgp-tools sequoia-keyring-linter
- ./.gitlab/check-keyids-change
only:
refs:
- merge_requests
changes:
- master-keyids
- packager-keyids
lint:
stage: lint
before_script:
- install -d "${PACMAN_CACHE}"
- pacman -Syu --needed --noconfirm --cachedir "${PACMAN_CACHE}" make flake8 mypy python-black python-isort
script:
- make lint
only:
refs:
- merge_requests
changes:
- keyringctl
build_install:
stage: integration
before_script:
- install -d "${PACMAN_CACHE}"
- pacman -Syu --needed --noconfirm --cachedir "${PACMAN_CACHE}" make python sequoia-sq
script:
- ./keyringctl import-main master/
- ./keyringctl import-main master-revoked/
- ./keyringctl import-packager packager/
- ./keyringctl import-packager packager-revoked/
- make
- make install PREFIX=/usr
- pacman-key --init
- pacman-key --populate archlinux
- pacman-key --updatedb
- pacman -Syu