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
# .github/workflows/test.yaml
# Name of the job in GitHub UI.
name: Test
# When to trigger?
on:
# Run on pushes to master branch
push:
branches:
# Run on PRs to the master branch
pull_request:
branches:
# Allow manual triggering via GitHub UI
workflow_dispatch:
# Cargo commands should show nice colours.
env:
CARGO_TERM_COLOR: always
jobs:
# Arbitrary name for this step.
test:
# Run on both x86-64 ubuntu and aarch64 macos.
strategy:
matrix:
os:
runs-on: ${{ matrix.os }}
steps:
# First check out the repository.
- uses: actions/checkout@v4
# Stable rust is part of the base image,
# but if nightly is needed, use this:
# - uses: dtolnay/rust-toolchain@nightly
# Caching build artefacts may speed up large builds.
- uses: Swatinem/rust-cache@v2
# Run all tests in debug and release mode.
# - run: cargo test
- run: cargo test -r