-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (57 loc) · 1.97 KB
/
build-and-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
name: Build and test
on: [ workflow_dispatch, pull_request_target, push ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-24.04, macos-latest]
features: [ all, no, default ]
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-24.04
- features: all
features_arg: --all-features
- features: no
features_arg: --no-default-features
- features: default
features_arg:
name: ${{ matrix.os }}, nightly, ${{ matrix.features }} features
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check
- name: Decrypt meshes
shell: bash
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
run: |
for FILE in collision_meshes/**/*.gpg; do
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output "${FILE%.gpg}" "$FILE"
done
- name: Get cached dependencies
uses: Swatinem/rust-cache@v2
- name: Build project (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH:C:\Program Files\LLVM\bin;=%
cargo build ${{ matrix.features_arg }}
- name: Build project
if: matrix.os != 'windows-latest'
run: cargo build ${{ matrix.features_arg }}
- name: Run tests
if: matrix.os != 'windows-latest'
run: cargo test ${{ matrix.features_arg }}