chore: fix license headers to PMPL-1.0-or-later #7
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
| # SPDX-License-Identifier: PMPL-1.0-or-later | |
| name: Zig FFI Build | |
| permissions: read-all | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'ffi/zig/**' | |
| - '.github/workflows/zig-ffi.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'ffi/zig/**' | |
| - '.github/workflows/zig-ffi.yml' | |
| workflow_dispatch: | |
| jobs: | |
| # Cross-compile from Ubuntu (most targets) | |
| build-cross: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| zig-version: ['0.13.0'] | |
| target: | |
| # Linux glibc | |
| - x86_64-linux-gnu | |
| - aarch64-linux-gnu | |
| # Linux musl (Alpine, Docker) | |
| - x86_64-linux-musl | |
| - aarch64-linux-musl | |
| # Windows | |
| - x86_64-windows-gnu | |
| # WASI | |
| - wasm32-wasi | |
| steps: | |
| - name: Checkout proven | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| path: proven | |
| - name: Checkout idris2-zig-ffi dependency | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| repository: hyperpolymath/idris2-zig-ffi | |
| path: idris2-zig-ffi | |
| - name: Setup Zig | |
| uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1 | |
| with: | |
| version: ${{ matrix.zig-version }} | |
| - name: Build FFI library | |
| working-directory: proven/ffi/zig | |
| run: zig build -Dtarget=${{ matrix.target }} | |
| - name: Run tests (native x86_64-linux only) | |
| if: matrix.target == 'x86_64-linux-gnu' | |
| working-directory: proven/ffi/zig | |
| run: zig build test | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
| with: | |
| name: proven-ffi-${{ matrix.target }} | |
| path: proven/ffi/zig/zig-out/ | |
| # macOS builds (native runners for code signing compatibility) | |
| build-macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-13 | |
| target: x86_64-macos | |
| - os: macos-14 | |
| target: aarch64-macos | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout proven | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| path: proven | |
| - name: Checkout idris2-zig-ffi dependency | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| repository: hyperpolymath/idris2-zig-ffi | |
| path: idris2-zig-ffi | |
| - name: Setup Zig | |
| uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1 | |
| with: | |
| version: '0.13.0' | |
| - name: Build FFI library | |
| working-directory: proven/ffi/zig | |
| run: zig build -Dtarget=${{ matrix.target }} | |
| - name: Run tests | |
| working-directory: proven/ffi/zig | |
| run: zig build test | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
| with: | |
| name: proven-ffi-${{ matrix.target }} | |
| path: proven/ffi/zig/zig-out/ | |
| wasm-browser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout proven | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| path: proven | |
| - name: Checkout idris2-zig-ffi dependency | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| with: | |
| repository: hyperpolymath/idris2-zig-ffi | |
| path: idris2-zig-ffi | |
| - name: Setup Zig | |
| uses: mlugg/setup-zig@e7d1537c378b83b8049f65dda471d87a2f7b2df2 # v1 | |
| with: | |
| version: '0.13.0' | |
| - name: Build WASM for browser | |
| working-directory: proven/ffi/zig | |
| run: zig build -Dtarget=wasm32-freestanding -Doptimize=ReleaseSmall | |
| - name: Upload WASM artifact | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
| with: | |
| name: proven-wasm-browser | |
| path: proven/ffi/zig/zig-out/lib/*.wasm | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [build-cross, build-macos, wasm-browser] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
| with: | |
| path: artifacts/ | |
| - name: List artifacts | |
| run: | | |
| echo "=== All ABI artifacts ===" | |
| find artifacts/ -type f | sort | |
| echo "" | |
| echo "=== Summary ===" | |
| echo "Linux glibc: x86_64, aarch64" | |
| echo "Linux musl: x86_64, aarch64" | |
| echo "macOS: x86_64 (Intel), aarch64 (Apple Silicon)" | |
| echo "Windows: x86_64" | |
| echo "WASM: browser (freestanding), WASI" |