|
| 1 | +name: Test |
| 2 | + |
| 3 | +permissions: |
| 4 | + checks: write |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + push: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.head_ref || github.run_id }}-${{ github.actor }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + validation: |
| 16 | + name: Validation |
| 17 | + runs-on: ubuntu-latest |
| 18 | + timeout-minutes: 1 |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Read .zig-version |
| 24 | + id: zigversion |
| 25 | + uses: juliangruber/read-file-action@v1 |
| 26 | + with: |
| 27 | + path: ./.zigversion |
| 28 | + - name: Install Zig |
| 29 | + uses: mlugg/setup-zig@v1 |
| 30 | + with: |
| 31 | + version: ${{ steps.zigversion.outputs.content }} |
| 32 | + |
| 33 | + - name: Lint |
| 34 | + run: zig fmt --check . --exclude externals/ |
| 35 | + |
| 36 | + build: |
| 37 | + needs: ["validation"] |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + os: |
| 42 | + # FIXME: Problem with x11 in CI (latest ubuntu). But it works on linux |
| 43 | + #- ubuntu-latest |
| 44 | + - macos-latest |
| 45 | + - windows-latest |
| 46 | + timeout-minutes: 20 |
| 47 | + runs-on: ${{matrix.os}} |
| 48 | + steps: |
| 49 | + - name: Checkout |
| 50 | + uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + submodules: true |
| 53 | + |
| 54 | + - if: matrix.os == 'ubuntu-latest' |
| 55 | + name: Prepare |
| 56 | + uses: awalsh128/cache-apt-pkgs-action@latest |
| 57 | + with: |
| 58 | + packages: libdbus-1-dev |
| 59 | + version: 1.0 |
| 60 | + |
| 61 | + - name: Read .zig-version |
| 62 | + id: zigversion |
| 63 | + uses: juliangruber/read-file-action@v1 |
| 64 | + with: |
| 65 | + path: ./.zigversion |
| 66 | + - name: Install Zig |
| 67 | + uses: mlugg/setup-zig@v1 |
| 68 | + with: |
| 69 | + version: ${{ steps.zigversion.outputs.content }} |
| 70 | + |
| 71 | + - name: Build |
| 72 | + run: .ci/build.sh |
| 73 | + |
| 74 | + |
| 75 | + # # TODO: Fix me |
| 76 | + # x86-64-linux: |
| 77 | + # needs: ["validation"] |
| 78 | + # name: x86-64 Linux |
| 79 | + # runs-on: ubuntu-latest |
| 80 | + # timeout-minutes: 20 |
| 81 | + # steps: |
| 82 | + # - name: Checkout |
| 83 | + # uses: actions/checkout@v4 |
| 84 | + # with: |
| 85 | + # submodules: true |
| 86 | + |
| 87 | + # - name: Prepare |
| 88 | + # uses: awalsh128/cache-apt-pkgs-action@latest |
| 89 | + # with: |
| 90 | + # packages: libdbus-1-dev |
| 91 | + # version: 1.0 |
| 92 | + |
| 93 | + # - name: Read .zig-version |
| 94 | + # id: zigversion |
| 95 | + # uses: juliangruber/read-file-action@v1 |
| 96 | + # with: |
| 97 | + # path: ./.zigversion |
| 98 | + # - name: Install Zig |
| 99 | + # uses: mlugg/setup-zig@v1 |
| 100 | + # with: |
| 101 | + # version: ${{ steps.zigversion.outputs.content }} |
| 102 | + |
| 103 | + # - name: Build |
| 104 | + # run: .ci/build.sh |
| 105 | + |
| 106 | + # # FIXME: this works on cetech1 CI but not in this repo. |
| 107 | + # arm64-macos: |
| 108 | + # needs: ["validation"] |
| 109 | + # name: arm64 Macos |
| 110 | + # runs-on: macos-latest |
| 111 | + # timeout-minutes: 20 |
| 112 | + # steps: |
| 113 | + # - name: Checkout |
| 114 | + # uses: actions/checkout@v4 |
| 115 | + # with: |
| 116 | + # submodules: true |
| 117 | + |
| 118 | + # - name: Read .zig-version |
| 119 | + # id: zigversion |
| 120 | + # uses: juliangruber/read-file-action@v1 |
| 121 | + # with: |
| 122 | + # path: ./.zigversion |
| 123 | + # - name: Install Zig |
| 124 | + # uses: mlugg/setup-zig@v1 |
| 125 | + # with: |
| 126 | + # version: ${{ steps.zigversion.outputs.content }} |
| 127 | + |
| 128 | + # - name: Build |
| 129 | + # run: .ci/build.sh |
| 130 | + |
| 131 | + # # FIXME: this works on cetech1 CI but not in this repo. |
| 132 | + # x86-64-windows: |
| 133 | + # needs: ["validation"] |
| 134 | + # name: x86-64 Windows |
| 135 | + # runs-on: windows-latest |
| 136 | + # timeout-minutes: 20 |
| 137 | + # steps: |
| 138 | + # - name: Checkout |
| 139 | + # uses: actions/checkout@v4 |
| 140 | + # with: |
| 141 | + # submodules: true |
| 142 | + |
| 143 | + # - name: Read .zig-version |
| 144 | + # id: zigversion |
| 145 | + # uses: juliangruber/read-file-action@v1 |
| 146 | + # with: |
| 147 | + # path: ./.zigversion |
| 148 | + # - name: Install Zig |
| 149 | + # uses: mlugg/setup-zig@v1 |
| 150 | + # with: |
| 151 | + # version: ${{ steps.zigversion.outputs.content }} |
| 152 | + |
| 153 | + # - name: Build |
| 154 | + # shell: bash |
| 155 | + # run: .ci/build.sh |
0 commit comments