Update the CI config #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "**/*.txt" | |
| - "**/*.log" | |
| - "**/*.png" | |
| - "**/*.svg" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "**/*.txt" | |
| - "**/*.log" | |
| - "**/*.png" | |
| - "**/*.svg" | |
| jobs: | |
| # ── Ubuntu (gcc + clang, full example builds) ────────────────────── | |
| ubuntu: | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| - name: Install compiler and libraries | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| pkg-config \ | |
| libboost-all-dev \ | |
| libconfig++-dev \ | |
| libfcgi-dev \ | |
| libglew-dev \ | |
| libglfw3-dev \ | |
| libglibmm-2.4-dev \ | |
| libglm-dev \ | |
| libglu1-mesa-dev \ | |
| libgtk-4-dev \ | |
| libopenal-dev \ | |
| libpipewire-0.3-dev \ | |
| libsdl2-dev \ | |
| libsdl2-mixer-dev \ | |
| libsfml-dev \ | |
| libvte-2.91-gtk4-dev \ | |
| libvulkan-dev \ | |
| libx11-dev \ | |
| freeglut3-dev \ | |
| qt6-base-dev \ | |
| librtaudio-dev | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then | |
| sudo apt-get install -y clang | |
| else | |
| sudo apt-get install -y g++ | |
| fi | |
| - name: Build | |
| run: go build -v -buildvcs=false -o oh ./cmd/oh | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test -v -count=1 ./... | |
| - name: Smoke test (hello example) | |
| run: | | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then | |
| export CXX=clang++ | |
| export CC=clang | |
| fi | |
| ./oh -C examples/hello clean | |
| ./oh -C examples/hello build | |
| ./oh -C examples/hello test | |
| ./oh -C examples/hello clean | |
| - name: Build examples (best effort) | |
| run: | | |
| if [ "${{ matrix.compiler }}" = "clang" ]; then | |
| export CXX=clang++ | |
| export CC=clang | |
| fi | |
| failed="" | |
| # Skip examples needing packages not in Ubuntu repos or with incompatible versions | |
| # SFML 3 is not yet in Ubuntu repos, so skip SFML-based examples | |
| # raylib and reactphysics3d are not in Ubuntu repos | |
| skip="bisqwit entities raylib raylib5 reactphysics sfml sfml_audio win64crate" | |
| for d in examples/*/; do | |
| name=$(basename "$d") | |
| echo "$skip" | grep -qw "$name" && { printf "=== %-30s SKIP\n" "$d"; continue; } | |
| printf "=== %-30s" "$d" | |
| if ./oh -C "$d" build > build.log 2>&1; then | |
| echo "OK" | |
| else | |
| echo "FAIL" | |
| cat build.log | |
| failed="$failed $d" | |
| fi | |
| done | |
| if [ -n "$failed" ]; then | |
| echo "" | |
| echo "Failed:$failed" | |
| exit 1 | |
| fi | |
| # ── Arch Linux (Docker, full example builds) ─────────────────────── | |
| archlinux: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| steps: | |
| - name: Install git | |
| run: pacman -Sy --noconfirm git | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| pacman -Sy --noconfirm archlinux-keyring | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm --needed \ | |
| base-devel go pkgconf \ | |
| boost fcgi freeglut glew glfw-x11 glibmm glm glu \ | |
| gtk4 libconfig libpipewire libx11 openal qt6-base \ | |
| raylib reactphysics3d rtaudio sdl2 sdl2_mixer \ | |
| sfml vte4 vulkan-headers vulkan-icd-loader | |
| - name: Build | |
| run: go build -v -buildvcs=false -o oh ./cmd/oh | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test -v -count=1 ./... | |
| - name: Smoke test (hello example) | |
| run: | | |
| ./oh -C examples/hello clean | |
| ./oh -C examples/hello build | |
| ./oh -C examples/hello test | |
| ./oh -C examples/hello clean | |
| - name: Build examples | |
| run: | | |
| failed="" | |
| skip="win64crate" | |
| for d in examples/*/; do | |
| name=$(basename "$d") | |
| echo "$skip" | grep -qw "$name" && { printf "=== %-30s SKIP\n" "$d"; continue; } | |
| printf "=== %-30s" "$d" | |
| if ./oh -C "$d" build > build.log 2>&1; then | |
| echo "OK" | |
| else | |
| echo "FAIL" | |
| cat build.log | |
| failed="$failed $d" | |
| fi | |
| done | |
| if [ -n "$failed" ]; then | |
| echo "" | |
| echo "Failed:$failed" | |
| exit 1 | |
| fi | |
| # ── macOS ────────────────────────────────────────────────────────── | |
| macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| - name: Install dependencies | |
| run: brew install pkg-config | |
| - name: Build | |
| run: go build -v -buildvcs=false -o oh ./cmd/oh | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test -v -count=1 ./... | |
| - name: Smoke test (hello example) | |
| run: | | |
| ./oh -C examples/hello clean | |
| ./oh -C examples/hello build | |
| ./oh -C examples/hello test | |
| ./oh -C examples/hello clean | |
| # ── FreeBSD ──────────────────────────────────────────────────────── | |
| freebsd: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: vmactions/freebsd-vm@v1 | |
| with: | |
| prepare: | | |
| pkg install -y go pkgconf | |
| run: | | |
| go build -v -buildvcs=false -o oh ./cmd/oh | |
| go vet ./... | |
| go test -v -count=1 ./... | |
| ./oh -C examples/hello clean | |
| ./oh -C examples/hello build | |
| ./oh -C examples/hello test | |
| ./oh -C examples/hello clean | |
| # ── OpenBSD ──────────────────────────────────────────────────────── | |
| openbsd: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: vmactions/openbsd-vm@v1 | |
| with: | |
| prepare: | | |
| pkg_add go gcc pkgconf | |
| run: | | |
| export CXX=eg++ | |
| export CC=egcc | |
| go build -v -buildvcs=false -o oh ./cmd/oh | |
| go vet ./... | |
| go test -v -count=1 ./... | |
| ./oh -C examples/hello clean | |
| ./oh -C examples/hello build | |
| ./oh -C examples/hello test | |
| ./oh -C examples/hello clean | |