feat: add native nulltickets pull mode #46
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux-x86_64 | |
| zig_target: x86_64-linux-musl | |
| - os: macos-latest | |
| target: macos-aarch64 | |
| zig_target: aarch64-macos | |
| - os: windows-latest | |
| target: windows-x86_64 | |
| zig_target: x86_64-windows | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Zig 0.15.2 | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Cache .zig-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .zig-cache | |
| key: zig-${{ matrix.target }}-${{ hashFiles('src/**/*.zig', 'build.zig') }} | |
| restore-keys: zig-${{ matrix.target }}- | |
| - name: Run tests | |
| run: zig build test --summary all 2>&1 | tee test-output.txt | |
| - name: Build ReleaseSmall | |
| run: zig build -Dtarget=${{ matrix.zig_target }} -Doptimize=ReleaseSmall | |
| - name: Cross-compile linux-aarch64 (Termux/ARM) | |
| if: runner.os == 'Linux' | |
| run: zig build -Dtarget=aarch64-linux-musl -Doptimize=ReleaseSmall | |
| - name: Job summary | |
| if: always() | |
| run: | | |
| echo "## NullBoiler CI — ${{ matrix.target }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY | |
| echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY | |
| if [ -f test-output.txt ]; then | |
| TESTS=$(grep -o '[0-9]*/[0-9]* tests passed' test-output.txt | head -1 || true) | |
| RSS=$(grep 'run test' test-output.txt | grep -o 'MaxRSS:[^ ]*' | head -1 | cut -d: -f2 || true) | |
| echo "| Tests | ${TESTS:-—} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Test MaxRSS | ${RSS:-—} |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| BIN="zig-out/bin/nullboiler" | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| BIN="zig-out/bin/nullboiler.exe" | |
| fi | |
| if [ -f "$BIN" ]; then | |
| SIZE=$(wc -c < "$BIN" | tr -d ' ') | |
| SIZE_HR=$(awk "BEGIN {printf \"%.1f MB\", $SIZE / 1048576}") | |
| echo "| Binary (ReleaseSmall) | ${SIZE_HR} (${SIZE} bytes) |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload binary | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nullboiler-${{ matrix.target }} | |
| path: zig-out/bin/nullboiler${{ runner.os == 'Windows' && '.exe' || '' }} |