-
Notifications
You must be signed in to change notification settings - Fork 68
121 lines (113 loc) · 3.23 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Run tests
on:
push:
branches:
- 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:
# The `ci-success` job doesn't actually test anything - it just aggregates the
# overall build status, otherwise the merge queue would need an entry
# for each individual job produced by the job-matrix.
#
# ALL THE SUBSEQUENT JOBS NEED THEIR `name` ADDED TO THE `needs` SECTION OF both "ci result" JOBS!
ci-success:
name: ci result
runs-on: ubuntu-latest
needs:
- rstar
- check
- no_std
if: success()
steps:
- name: Mark the job as a success
run: exit 0
ci-failure:
name: ci result
runs-on: ubuntu-latest
needs:
- rstar
- check
- no_std
if: failure()
steps:
- name: Mark the job as a failure
run: exit 1
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)
- "georust/geo-ci:proj-9.2.1-rust-1.65"
# Two most recent releases - we omit older ones for expedient CI
- "georust/geo-ci:proj-9.2.1-rust-1.71"
- "georust/geo-ci:proj-9.2.1-rust-1.72"
container:
image: ${{ matrix.container_image }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo install --version 1.6.0 cargo-all-features
- run: cargo build-all-features
- run: cargo test-all-features
- run: cargo build -p rstar-benches
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: 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: 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) }}