Simplify CI #351
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: Run tests | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- staging | |
- trying | |
- release/** | |
pull_request: | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
rstar: | |
name: rstar | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
defaults: | |
run: | |
working-directory: rstar | |
strategy: | |
matrix: | |
container_image: | |
# We aim to support rust-stable plus (at least) the prior 3 releases, | |
# giving us about 6 months of coverage. | |
# | |
# Minimum supported rust version (MSRV) | |
- "ghcr.io/georust/geo-ci:rust-1.63" | |
# Two most recent releases - we omit older ones for expedient CI | |
- "ghcr.io/georust/geo-ci:proj-9.6.0-rust-1.83" | |
- "ghcr.io/georust/geo-ci:proj-9.6.0-rust-1.84" | |
container: | |
image: ${{ matrix.container_image }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.container_image }} | |
- run: cargo check --all-targets --workspace | |
- run: cargo test --workspace | |
- run: cargo build -p rstar-benches --workspace | |
check: | |
name: rstar Rustfmt and Clippy check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting using Rustfmt | |
run: cargo fmt --check | |
- name: Lint using Clippy | |
run: cargo clippy --tests | |
no_std: | |
name: rstar no_std test | |
runs-on: ubuntu-latest | |
env: | |
NO_STD_TARGET: aarch64-unknown-none | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{env.NO_STD_TARGET}} | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: no-std-${{env.NO_STD_TARGET}} | |
- name: Run cargo build for ${{env.NO_STD_TARGET}} | |
run: cargo build --package rstar --target ${{env.NO_STD_TARGET}} | |
conclusion: | |
needs: | |
- rstar | |
- check | |
- no_std | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Result | |
run: | | |
jq -C <<< "${needs}" | |
# Check if all needs were successful or skipped. | |
"$(jq -r 'all(.result as $result | (["success", "skipped"] | contains([$result])))' <<< "${needs}")" | |
env: | |
needs: ${{ toJson(needs) }} |