-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (137 loc) · 4.49 KB
/
test.yaml
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- trunk
workflow_dispatch:
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
ROW_COLOR: always
CLICOLOR: 1
RUST_LATEST_VERSION: 1.81.0
jobs:
unit_test:
name: Unit test [${{ matrix.mode }}-rust-${{ matrix.rust }}-${{ matrix.os }}]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
- macos-14
rust:
# Oldest supported version of rust
- 1.77.2
- 1.81.0
mode:
- debug
include:
# Add a release build on linux with the latest version of rust
- os: ubuntu-22.04
rust: 1.81.0
mode: release
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Update rust
run: rustup install ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- name: Check rust installation
run: rustc -vV
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-${{ matrix.rust }}-cargo-unit-test-${{ matrix.mode }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build ${{ matrix.mode == 'release' && '--release' || '' }} --verbose
- name: Run tests
run: cargo test ${{ matrix.mode == 'release' && '--release' || '' }} --verbose
execute_tutorials:
name: Execute tutorials
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Update rust
run: rustup install "$RUST_LATEST_VERSION" --no-self-update && rustup default "$RUST_LATEST_VERSION"
- name: Check rust installation
run: rustc -vV
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-${{ env.RUST_LATEST_VERSION }}-cargo-execute-tutorials-${{ hashFiles('**/Cargo.lock') }}
- name: Install
run: cargo install --path . --locked --verbose
- name: Run hello.sh
run: bash hello.sh
working-directory: doc/src/guide/tutorial
env:
ROW_YES: "true"
- name: Run group.sh
run: bash group.sh
working-directory: doc/src/guide/tutorial
env:
ROW_YES: "true"
# The signac test requires python
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.12"
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@ae7e7c6931098a313ef8069ef04b88a55c3a40f6 # 0.3.0
with:
lockfile: ".github/workflows/signac-requirements.txt"
- name: Run signac.sh
run: bash signac.sh
working-directory: doc/src/guide/python
env:
ROW_YES: "true"
build_documentation:
name: Build documentation
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up mdbook
uses: glotzerlab/workflows/setup-mdbook@ae7e7c6931098a313ef8069ef04b88a55c3a40f6 # 0.3.0
- name: Build documentation
run: mdbook build doc
env:
RUST_LOG: "mdbook=info"
- name: Check links
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
with:
args: -n .
fail: true
check_licenses:
name: Check licenses
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up cargo-bundle-licenses
uses: glotzerlab/workflows/setup-cargo-bundle-licenses@ae7e7c6931098a313ef8069ef04b88a55c3a40f6 # 0.3.0
- name: Check bundled licenses
run: cargo bundle-licenses --format yaml --output CI.yaml --previous THIRDPARTY.yaml --check-previous
tests_complete:
name: All tests
if: always()
needs: [unit_test, execute_tutorials, build_documentation,check_licenses]
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0