| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | pull_request: |
| 8 | types: |
| 9 | - opened |
| 10 | - reopened |
| 11 | - review_requested |
| 12 | - ready_for_review |
| 13 | - synchronize |
| 14 | workflow_dispatch: |
| 15 | |
| 16 | permissions: |
| 17 | contents: read |
| 18 | |
| 19 | jobs: |
| 20 | linux: |
| 21 | runs-on: ${{ matrix.platform.runner }} |
| 22 | if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} |
| 23 | strategy: |
| 24 | matrix: |
| 25 | platform: |
| 26 | - runner: ubuntu-24.04 |
| 27 | target: x86_64 |
| 28 | - runner: ubuntu-24.04 |
| 29 | target: aarch64 |
| 30 | - runner: ubuntu-24.04 |
| 31 | target: armv7 |
| 32 | - runner: ubuntu-24.04 |
| 33 | target: s390x |
| 34 | - runner: ubuntu-24.04 |
| 35 | target: ppc64le |
| 36 | steps: |
| 37 | - uses: actions/checkout@v4 |
| 38 | - uses: mlugg/setup-zig@v2 |
| 39 | with: |
| 40 | version: 0.15.2 |
| 41 | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 42 | with: |
| 43 | cache: true |
| 44 | - uses: taiki-e/install-action@nextest |
| 45 | - name: Build and compile project |
| 46 | run: cargo nextest run --workspace --all-features --no-run |
| 47 | - name: Run tests |
| 48 | run: cargo nextest run --workspace --all-features |
| 49 | - name: Run doctests |
| 50 | run: cargo test --doc --workspace --all-features |
| 51 | |
| 52 | musllinux: |
| 53 | runs-on: ${{ matrix.platform.runner }} |
| 54 | if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} |
| 55 | strategy: |
| 56 | matrix: |
| 57 | platform: |
| 58 | - runner: ubuntu-24.04 |
| 59 | target: x86_64 |
| 60 | - runner: ubuntu-24.04 |
| 61 | target: aarch64 |
| 62 | - runner: ubuntu-24.04 |
| 63 | target: armv7 |
| 64 | steps: |
| 65 | - uses: actions/checkout@v4 |
| 66 | - uses: mlugg/setup-zig@v2 |
| 67 | with: |
| 68 | version: 0.15.2 |
| 69 | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 70 | with: |
| 71 | cache: true |
| 72 | - uses: taiki-e/install-action@nextest |
| 73 | - name: Build and compile project |
| 74 | run: cargo nextest run --workspace --all-features --no-run |
| 75 | - name: Run tests |
| 76 | run: cargo nextest run --workspace --all-features |
| 77 | - name: Run doctests |
| 78 | run: cargo test --doc --workspace --all-features |
| 79 | |
| 80 | windows: |
| 81 | runs-on: ${{ matrix.platform.runner }} |
| 82 | if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} |
| 83 | strategy: |
| 84 | matrix: |
| 85 | platform: |
| 86 | - runner: windows-latest |
| 87 | target: x64 |
| 88 | steps: |
| 89 | - uses: actions/checkout@v4 |
| 90 | - uses: mlugg/setup-zig@v2 |
| 91 | with: |
| 92 | version: 0.15.2 |
| 93 | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 94 | with: |
| 95 | cache: true |
| 96 | - uses: taiki-e/install-action@nextest |
| 97 | - name: Build and compile project |
| 98 | run: cargo nextest run --workspace --all-features --no-run |
| 99 | - name: Run tests |
| 100 | run: cargo nextest run --workspace --all-features |
| 101 | - name: Run doctests |
| 102 | run: cargo test --doc --workspace --all-features |
| 103 | |
| 104 | macos: |
| 105 | runs-on: ${{ matrix.platform.runner }} |
| 106 | if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} |
| 107 | strategy: |
| 108 | matrix: |
| 109 | platform: |
| 110 | - runner: macos-14 |
| 111 | target: aarch64 |
| 112 | steps: |
| 113 | - uses: actions/checkout@v4 |
| 114 | - uses: mlugg/setup-zig@v2 |
| 115 | with: |
| 116 | version: 0.15.2 |
| 117 | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 118 | with: |
| 119 | cache: true |
| 120 | - uses: taiki-e/install-action@nextest |
| 121 | - name: Build and compile project |
| 122 | run: cargo nextest run --workspace --all-features --no-run |
| 123 | - name: Run tests |
| 124 | run: cargo nextest run --workspace --all-features |
| 125 | - name: Run doctests |
| 126 | run: cargo test --doc --workspace --all-features |
| 127 | |
| 128 | ci: |
| 129 | name: CI |
| 130 | if: ${{ always() && (github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)) }} |
| 131 | needs: [linux, musllinux, windows, macos] |
| 132 | runs-on: ubuntu-latest |
| 133 | steps: |
| 134 | - run: | |
| 135 | result="${{ (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && 'failure' || 'success' }}" |
| 136 | echo "result: $result" |
| 137 | [[ "$result" == "success" ]] || exit 1 |