ci: run lint, tests and build for each commit
ci/woodpecker/push/woodpecker Pipeline was successful Details

the CI uses a custom image produced by tools/ci-containerfile.
see instructions in the readme.

CI logs are at https://woodpecker.qcode.ch/nakamochi/ndg
pull/20/head
alex 2 years ago
parent fe68ae96d6
commit 5c60b92f85
Signed by: x1ddos
GPG Key ID: FDEFB4A63CBD8460

@ -0,0 +1,17 @@
pipeline:
lint:
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
commands:
- ./tools/fmt-check.sh
test:
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
commands:
- zig build test
aarch64:
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
commands:
- zig build -Ddriver=fbev -Dtarget=aarch64-linux-musl
sdl2:
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
commands:
- zig build -Ddriver=sdl2

@ -40,7 +40,38 @@ when browsing `git blame`:
git config blame.ignoreRevsFile .git-blame-ignore-revs git config blame.ignoreRevsFile .git-blame-ignore-revs
see also the contributing section. see also the [contributing](#contributing) section.
## CI automated checks
the CI runs code format checks, tests and builds for fbdev+evdev on aarch64
and SDL2. it requires a container image with zig and clang tools such as
clang-format.
to make a new image and switch the CI to use it, first modify the
[ci-containerfile](tools/ci-containerfile) and produce the image locally:
podman build --rm -t ndg-ci -f ./tools/ci-containerfile \
--build-arg ZIGURL=https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz
then tag it with the target URL, for example:
podman tag localhost/ndg-ci git.qcode.ch/nakamochi/ci-zig0.10.1:v1
generate an [access token](https://git.qcode.ch/user/settings/applications),
login to the container registry and push the image to remote:
podman login git.qcode.ch
podman push git.qcode.ch/nakamochi/ci-zig0.10.1:v1
the image will be available at
https://git.qcode.ch/nakamochi/-/packages/
finally, delete the access token from
https://git.qcode.ch/user/settings/applications
what's left is to update the CI [build pipeline](.woodpecker.yml) and delete
the older version of the image.
## contributing ## contributing

@ -0,0 +1,15 @@
# ci container file for compiling and testing zig projects.
# requires a ZIGURL build arg. for instance:
# podman build --rm -t ci-zig0.10.1 -f ci-containerfile \
# --build-arg ZIGURL=https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz
FROM alpine:3.17.1
ARG ZIGURL
RUN apk add --no-cache curl xz sdl2-dev clang15-extra-tools && \
mkdir -p /tools/zig && \
cd /tools/zig && \
curl -o zig.tar.xz $ZIGURL && \
tar -xf zig.tar.xz --strip-components=1 && \
rm zig.tar.xz
ENV PATH="/tools/zig:$PATH"