| 1 | # Tests per README "Quick start": `cargo test`. Linux and Windows are the supported |
| 2 | # targets (README "Status"); macOS runs no tests here (its Ctrl/Cmd bindings fail the |
| 3 | # key tests), it only builds - see build.yml. |
| 4 | name: Test |
| 5 | |
| 6 | # Tests gate pushes to main and pull requests; releases build from tags in build.yml. |
| 7 | on: |
| 8 | push: |
| 9 | branches: [main] |
| 10 | pull_request: |
| 11 | workflow_dispatch: |
| 12 | |
| 13 | permissions: |
| 14 | contents: read |
| 15 | |
| 16 | concurrency: |
| 17 | group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | cancel-in-progress: true |
| 19 | |
| 20 | env: |
| 21 | CARGO_TERM_COLOR: always |
| 22 | |
| 23 | jobs: |
| 24 | linux: |
| 25 | name: Linux |
| 26 | runs-on: ubuntu-latest |
| 27 | timeout-minutes: 90 |
| 28 | # webrtc-sys compiles its C++ against the hermetic libc++ inside the libwebrtc |
| 29 | # artifact, which needs a clang as new as that libc++ (clang 21 today, see |
| 30 | # check_clang_version in vendor/webrtc-sys/build.rs). The distro clang is older |
| 31 | # (18 on ubuntu-24.04), so setup-linux installs clang 21 and these point every |
| 32 | # compile and the final link at it. |
| 33 | env: |
| 34 | CC: clang-21 |
| 35 | CXX: clang++-21 |
| 36 | CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21 |
| 37 | steps: |
| 38 | - uses: actions/checkout@v6 |
| 39 | |
| 40 | - uses: ./.github/actions/setup-linux |
| 41 | |
| 42 | - uses: dtolnay/rust-toolchain@stable |
| 43 | |
| 44 | - uses: Swatinem/rust-cache@v2 |
| 45 | with: |
| 46 | key: test |
| 47 | |
| 48 | - name: Tests |
| 49 | run: cargo test |
| 50 | |
| 51 | windows: |
| 52 | name: Windows |
| 53 | runs-on: windows-latest |
| 54 | timeout-minutes: 90 |
| 55 | defaults: |
| 56 | run: |
| 57 | shell: bash |
| 58 | steps: |
| 59 | - uses: actions/checkout@v6 |
| 60 | |
| 61 | - uses: dtolnay/rust-toolchain@stable |
| 62 | |
| 63 | - uses: Swatinem/rust-cache@v2 |
| 64 | with: |
| 65 | key: test |
| 66 | |
| 67 | # After the toolchain: staging runs `cargo metadata`. |
| 68 | - uses: ./.github/actions/setup-windows |
| 69 | |
| 70 | - name: Tests |
| 71 | run: cargo test --config "patch.crates-io.gpui-pre-windows.path=\"$GPUI_PRE_WINDOWS_PATCHED\"" |