| 1 |
name: CI |
| 2 |
on: |
| 3 |
pull_request: |
| 4 |
merge_group: |
| 5 |
|
| 6 |
jobs: |
| 7 |
test: |
| 8 |
runs-on: ${{ matrix.os }} |
| 9 |
strategy: |
| 10 |
matrix: |
| 11 |
include: |
| 12 |
- name: stable linux |
| 13 |
os: ubuntu-latest |
| 14 |
rust: stable |
| 15 |
target: x86_64-unknown-linux-gnu |
| 16 |
- name: beta linux |
| 17 |
os: ubuntu-latest |
| 18 |
rust: beta |
| 19 |
target: x86_64-unknown-linux-gnu |
| 20 |
- name: nightly linux |
| 21 |
os: ubuntu-latest |
| 22 |
rust: nightly |
| 23 |
target: x86_64-unknown-linux-gnu |
| 24 |
- name: stable x86_64-unknown-linux-musl |
| 25 |
os: ubuntu-22.04 |
| 26 |
rust: stable |
| 27 |
target: x86_64-unknown-linux-musl |
| 28 |
- name: stable x86_64 macos |
| 29 |
os: macos-latest |
| 30 |
rust: stable |
| 31 |
target: x86_64-apple-darwin |
| 32 |
- name: stable aarch64 macos |
| 33 |
os: macos-latest |
| 34 |
rust: stable |
| 35 |
target: aarch64-apple-darwin |
| 36 |
- name: stable windows-msvc |
| 37 |
os: windows-latest |
| 38 |
rust: stable |
| 39 |
target: x86_64-pc-windows-msvc |
| 40 |
- name: msrv |
| 41 |
os: ubuntu-22.04 |
| 42 |
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml |
| 43 |
rust: 1.88.0 |
| 44 |
target: x86_64-unknown-linux-gnu |
| 45 |
name: ${{ matrix.name }} |
| 46 |
steps: |
| 47 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 48 |
- name: Install Rust |
| 49 |
run: bash ci/install-rust.sh ${{ matrix.rust }} ${{ matrix.target }} |
| 50 |
- name: Build and run tests |
| 51 |
run: cargo test --workspace --locked --target ${{ matrix.target }} |
| 52 |
- name: Test no default |
| 53 |
run: cargo test --workspace --no-default-features --target ${{ matrix.target }} |
| 54 |
|
| 55 |
aarch64-cross-builds: |
| 56 |
runs-on: ubuntu-22.04 |
| 57 |
steps: |
| 58 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 59 |
- name: Install Rust |
| 60 |
run: bash ci/install-rust.sh stable aarch64-unknown-linux-musl |
| 61 |
- name: Build |
| 62 |
run: cargo build --locked --target aarch64-unknown-linux-musl |
| 63 |
|
| 64 |
rustfmt: |
| 65 |
name: Rustfmt |
| 66 |
runs-on: ubuntu-latest |
| 67 |
steps: |
| 68 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 69 |
- name: Install Rust |
| 70 |
run: rustup update stable && rustup default stable && rustup component add rustfmt |
| 71 |
- run: cargo fmt --check |
| 72 |
|
| 73 |
gui: |
| 74 |
name: GUI tests |
| 75 |
runs-on: ubuntu-latest |
| 76 |
steps: |
| 77 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 78 |
- name: Install Rust |
| 79 |
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu |
| 80 |
- name: Install npm |
| 81 |
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
| 82 |
with: |
| 83 |
node-version: 24 |
| 84 |
- name: Install browser-ui-test |
| 85 |
run: npm install |
| 86 |
- name: Run eslint |
| 87 |
run: npm run lint |
| 88 |
- name: Build and run tests (+ GUI) |
| 89 |
run: cargo test --locked --target x86_64-unknown-linux-gnu --test gui |
| 90 |
|
| 91 |
# Ensure there are no clippy warnings |
| 92 |
clippy: |
| 93 |
runs-on: ubuntu-latest |
| 94 |
steps: |
| 95 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 96 |
- name: Install Rust |
| 97 |
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu |
| 98 |
- run: rustup component add clippy |
| 99 |
- run: cargo clippy --workspace --all-targets --no-deps -- -D warnings |
| 100 |
|
| 101 |
docs: |
| 102 |
name: Check API docs |
| 103 |
runs-on: ubuntu-latest |
| 104 |
steps: |
| 105 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 106 |
- name: Install Rust |
| 107 |
run: bash ci/install-rust.sh stable x86_64-unknown-linux-gnu |
| 108 |
- name: Ensure intradoc links are valid |
| 109 |
run: cargo doc --workspace --document-private-items --no-deps |
| 110 |
env: |
| 111 |
RUSTDOCFLAGS: -D warnings |
| 112 |
|
| 113 |
check-version-bump: |
| 114 |
name: Check version bump |
| 115 |
runs-on: ubuntu-latest |
| 116 |
steps: |
| 117 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 118 |
- run: rustup update stable && rustup default stable |
| 119 |
- name: Install cargo-semver-checks |
| 120 |
run: | |
| 121 |
mkdir installed-bins |
| 122 |
curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.48.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \ |
| 123 |
| tar -xz --directory=./installed-bins |
| 124 |
echo `pwd`/installed-bins >> $GITHUB_PATH |
| 125 |
- run: cargo semver-checks --workspace |
| 126 |
|
| 127 |
# The success job is here to consolidate the total success/failure state of |
| 128 |
# all other jobs. This job is then included in the GitHub branch protection |
| 129 |
# rule which prevents merges unless all other jobs are passing. This makes |
| 130 |
# it easier to manage the list of jobs via this yml file and to prevent |
| 131 |
# accidentally adding new jobs without also updating the branch protections. |
| 132 |
success: |
| 133 |
name: Success gate |
| 134 |
if: always() |
| 135 |
needs: |
| 136 |
- test |
| 137 |
- rustfmt |
| 138 |
- aarch64-cross-builds |
| 139 |
- gui |
| 140 |
- clippy |
| 141 |
- docs |
| 142 |
- check-version-bump |
| 143 |
runs-on: ubuntu-latest |
| 144 |
steps: |
| 145 |
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
| 146 |
- name: Done |
| 147 |
run: exit 0 |