CI: use gitlab-ci

This commit is contained in:
Oliver Smith 2024-01-16 21:37:17 +00:00
parent 6ffb174870
commit 13f277a56c
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
3 changed files with 42 additions and 28 deletions

View File

@ -1,26 +0,0 @@
image: alpine/edge
packages:
- sudo
sources:
- https://git.sr.ht/~postmarketos/pmbootstrap
tasks:
- note: |
pmbootstrap/.ci/note.sh
- shellcheck: |
cd pmbootstrap
sudo .ci/shellcheck.sh
- ruff: |
cd pmbootstrap
sudo .ci/ruff.sh
- vermin: |
cd pmbootstrap
sudo .ci/vermin.sh
- codespell: |
cd pmbootstrap
sudo .ci/codespell.sh
- pytest: |
cd pmbootstrap
sudo .ci/pytest.sh
artifacts:
- ".local/var/pmbootstrap/log.txt"
- ".local/var/pmbootstrap/log_testsuite.txt"

View File

@ -1,6 +1,7 @@
#!/bin/sh -e
printf "\n"
printf "==============================================\n"
printf "PROTIP: use"
printf " \e[1;32mpmbootstrap ci\e[0m"
printf " \e[1;33mpmbootstrap ci\e[0m"
printf " to run these scripts locally.\n"
printf "==============================================\n"

39
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,39 @@
image: alpine:edge
before_script:
- ".ci/note.sh"
- "echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories"
- "adduser -D build"
stages:
- lint
- test
codespell:
stage: lint
script:
- ".ci/codespell.sh"
pytest:
stage: test
script:
- "apk -q add git"
- "su build -c 'git config --global user.email ci@ci'"
- "su build -c 'git config --global user.name CI'"
- "echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
- ".ci/pytest.sh"
ruff:
stage: lint
script:
- ".ci/ruff.sh"
shellcheck:
stage: lint
script:
- ".ci/shellcheck.sh"
vermin:
stage: lint
script:
- ".ci/vermin.sh"