-
Notifications
You must be signed in to change notification settings - Fork 81
45 lines (42 loc) · 1.18 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
name: Run tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
check-rust-compat:
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: ["1.75", "1.76", "1.78"]
steps:
- name: rustup toolchain install ${{ matrix.rust_version }}
run: |
rustup toolchain install ${{ matrix.rust_version }}
- uses: actions/checkout@v4
- run: rustup override set ${{ matrix.rust_version }}
- run: rustup component add rustfmt
- name: cargo check
run: cargo check
- name: cargo fmt --check
run: cargo fmt --check
test:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1
- name: Run tests (whole workspace, including desktop)
if: ${{ matrix.os != 'ubuntu-latest' }}
run: cargo test --workspace
- name: Run tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo test