🧪 Unit Tests · main #259
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: Unit Tests | |
| run-name: "🧪 Unit Tests · ${{ github.event_name == 'workflow_dispatch' && 'Manual Run' || (github.event_name == 'pull_request' && format('PR #{0}', github.event.pull_request.number) || github.ref_name) }}" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Unit Test (${{ matrix.os }} - ${{ matrix.arch }} - Zig ${{ matrix.version }}) | |
| strategy: | |
| matrix: | |
| # 架构配置标识符 | |
| arch_config: [linux-x86_64, linux-aarch64, macos-arm64, windows-x86_64] | |
| version: ["0.14.1", "0.15.1", "0.16.0"] | |
| include: | |
| # Linux x86_64 | |
| - arch_config: linux-x86_64 | |
| os: ubuntu-latest | |
| arch: x86_64 | |
| runner: ubuntu-latest | |
| # Linux aarch64 | |
| - arch_config: linux-aarch64 | |
| os: ubuntu-latest | |
| arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| # macOS arm64 | |
| - arch_config: macos-arm64 | |
| os: macos-latest | |
| arch: arm64 | |
| runner: macos-14 | |
| # Windows x86_64 | |
| - arch_config: windows-x86_64 | |
| os: windows-latest | |
| arch: x86_64 | |
| runner: windows-latest | |
| fail-fast: false | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Zig | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| - name: Run unit tests | |
| run: zig build test --summary all | |