-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (49 loc) · 1.46 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
name: Test
on:
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
push:
# Run weekly on the default branch to make sure it always builds with the latest rust release
schedule:
- cron: '30 5 * * 1'
jobs:
test-matrix:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: [self-hosted, linux, arm64]
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: [self-hosted, macos, arm64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
- name: Test Stable
run: cargo test
- name: Test Oldstable
run: |
oldstable=$(cat Cargo.toml | grep rust-version | sed 's/.*"\(.*\)".*/\1/')
rustup toolchain install --profile minimal $oldstable
rustup default $oldstable
cargo test
- name: Clippy
run: |
rustup component add clippy
cargo clippy
- name : Rustfmt
run: |
rustup toolchain install nightly -c rustfmt
cargo +nightly fmt -- --check