feat: Zig 0.16.0 compatibility #88
Workflow file for this run
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: "Burrito Cross Build Build Tests" | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build_examples: | |
| name: build_examples_${{ matrix.host }}_${{ matrix.zig }} | |
| runs-on: ${{ matrix.host }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| host: [ubuntu-latest, macos-latest, macos-14] # macos-14 is arm64 | |
| zig: ["0.15.2", "0.16.0"] | |
| exclude: | |
| # macos-14 (arm64) is only needed to verify cross-compile from | |
| # Apple Silicon. Skip the old Zig version there to save CI time. | |
| - host: macos-14 | |
| zig: "0.15.2" | |
| steps: | |
| # Deps | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| if: matrix.host == 'ubuntu-latest' | |
| with: | |
| otp-version: "27.3" | |
| elixir-version: "1.18.3" | |
| - uses: erlef/setup-beam@v1 | |
| if: matrix.host == 'macos-latest' || matrix.host == 'macos-14' | |
| with: | |
| otp-version: "27.3" | |
| elixir-version: "1.18.3" | |
| - uses: goto-bus-stop/setup-zig@v2 | |
| with: | |
| version: ${{ matrix.zig }} | |
| - name: Set up Homebrew | |
| if: matrix.host == 'macos-latest' || matrix.host == 'macos-14' | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@master | |
| - run: sudo apt-get -y install xz-utils | |
| if: matrix.host == 'ubuntu-latest' | |
| - run: brew install elixir xz | |
| if: matrix.host == 'macos-latest' || matrix.host == 'macos-14' | |
| # Restore Cache | |
| - uses: actions/cache/restore@v3 | |
| if: matrix.host == 'ubuntu-latest' | |
| id: cache-restore-linux | |
| with: | |
| path: /home/runner/.cache/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| - uses: actions/cache/restore@v3 | |
| if: matrix.host == 'macos-latest' | |
| id: cache-restore-macos-intel | |
| with: | |
| path: /Users/runner/Library/Caches/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| - uses: actions/cache/restore@v3 | |
| if: matrix.host == 'macos-14' | |
| id: cache-restore-macos-arm | |
| with: | |
| path: /Users/runner/Library/Caches/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| # Run unit tests (Args module) on at least one host — args parsing | |
| # is platform-independent. | |
| - name: mix test | |
| if: matrix.host == 'ubuntu-latest' && matrix.zig == '0.16.0' | |
| run: mix test | |
| # Build Example CLI App | |
| - name: cli_example | |
| working-directory: "./examples/cli_example" | |
| run: "mix deps.get && mix release" | |
| # Save Cache (Linux) | |
| - uses: actions/cache/save@v3 | |
| if: matrix.host == 'ubuntu-latest' | |
| id: cache-save-linux | |
| with: | |
| path: /home/runner/.cache/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| # Save Cache (macOS) | |
| - uses: actions/cache/save@v3 | |
| if: matrix.host == 'macos-latest' | |
| id: cache-save-macos-intel | |
| with: | |
| path: /Users/runner/Library/Caches/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| - uses: actions/cache/save@v3 | |
| if: matrix.host == 'macos-14' | |
| id: cache-save-macos-arm | |
| with: | |
| path: /Users/runner/Library/Caches/burrito_file_cache/ | |
| key: burrito-download-cache_${{ matrix.host }}_${{ matrix.zig }} | |
| # Upload Wrapped Binaries | |
| - name: Upload Binaries | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: burrito_${ matrix.host }_${ matrix.zig }_host_bins | |
| path: ./examples/**/burrito_out/* | |
| retention-days: 1 | |
| #### Run example binaries #### | |
| # Windows binaries: built on Linux/macOS hosts, run on windows-latest | |
| run_examples_windows: | |
| needs: build_examples | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| host: [ubuntu-latest, macos-latest] | |
| zig: ["0.15.2", "0.16.0"] | |
| runs-on: windows-latest | |
| steps: | |
| - name: Download a single artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: burrito_${ matrix.host }_${ matrix.zig }_host_bins | |
| # Run with no args first, then with args, to verify the wrapper's | |
| # argument passing works on Windows too. | |
| - name: Run with no args | |
| run: cli_example/burrito_out/example_cli_app_windows.exe | |
| - name: Run with args (verifies quoted args round-trip) | |
| run: | | |
| cli_example/burrito_out/example_cli_app_windows.exe --foo "bar baz" --qux | |
| run_examples_linux: | |
| needs: build_examples | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| host: [ubuntu-latest, macos-latest, macos-14] | |
| zig: ["0.15.2", "0.16.0"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download a single artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: burrito_${ matrix.host }_${ matrix.zig }_host_bins | |
| - name: Run with no args | |
| run: | | |
| chmod +x cli_example/burrito_out/example_cli_app_linux | |
| cli_example/burrito_out/example_cli_app_linux | |
| - name: Run with args (verifies quoted args round-trip) | |
| run: | | |
| cli_example/burrito_out/example_cli_app_linux --foo "bar baz" --qux | |
| run_examples_macos: | |
| needs: build_examples | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| host: [ubuntu-latest, macos-latest, macos-14] | |
| zig: ["0.15.2", "0.16.0"] | |
| runs-on: ${{ matrix.host == 'macos-14' && 'macos-14' || 'macos-latest' }} | |
| steps: | |
| - name: Download a single artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: burrito_${ matrix.host }_${ matrix.zig }_host_bins | |
| - name: Run with no args | |
| run: | | |
| chmod +x cli_example/burrito_out/example_cli_app_macos | |
| cli_example/burrito_out/example_cli_app_macos | |
| - name: Run with args (verifies quoted args round-trip) | |
| run: | | |
| cli_example/burrito_out/example_cli_app_macos --foo "bar baz" --qux |