diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a1cc35c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + # Using actions/checkout causes problems with git describe and tags, + # we want upstream tags. + run: | + git clone https://github.com/${{ github.repository }} test + cd test + git checkout ${{ github.ref_name }} + git remote add upstream https://github.com/nakamochi/ndg + git fetch upstream + git -C . describe --match 'v*.*.*' --tags --abbrev=8 + - name: Set up Zig + uses: goto-bus-stop/setup-zig@v2 + with: + version: '0.12.0' + - name: Lint + run: | + cd test + ./tools/fmt-check.sh + - name: Test + run: | + cd test + zig build test + - name: Build SDL2 + run: | + sudo apt-get -y install libsdl2-dev + cd test + zig build -Ddriver=sdl2 + - name: Build X11 + run: | + cd test + zig build -Ddriver=x11 + - name: Build Aarch64 + run: | + cd test + zig build -Ddriver=fbev -Dtarget=aarch64-linux-musl -Doptimize=ReleaseSafe -Dstrip + sha256sum zig-out/bin/nd zig-out/bin/ngui + - name: Playground + run: | + cd test + zig build guiplay btcrpc lndhc diff --git a/README.md b/README.md index bea7102..74d05f8 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,11 @@ 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. +there is now support for GitHub Actions, it's described in the +[.github/workflows/ci.yml](.github/workflows/ci.yml) file. + +below are description for the original CI setup. + 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: