-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (54 loc) · 1.58 KB
/
main.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
57
name: Format and Test
on:
push:
branches:
- "**"
paths-ignore:
- "**.md"
pull_request:
branches:
- "**"
paths-ignore:
- "**.md"
jobs:
slprs_cargo_fmt:
name: Cargo Format
runs-on: ubuntu-latest
outputs:
rust_ver: ${{ steps.rust_ver.outputs.rust_ver }}
steps:
- uses: actions/checkout@v3
- id: rust_ver
name: Grab Rust Version
run: echo "rust_ver=$(sed -rn 's/^channel = "(.*)"/\1/p' rust-toolchain.toml)" >> "$GITHUB_OUTPUT"
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust_ver.outputs.rust_ver }}
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
slprs_cargo_test:
needs: slprs_cargo_fmt
name: Cargo Test on rust ${{ needs.slprs_cargo_fmt.outputs.rust_ver }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ needs.slprs_cargo_fmt.outputs.rust_ver }}
components: rustfmt
- name: "Install prerequisites"
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo dpkg --add-architecture amd64
sudo apt update
sudo apt install \
libasound2-dev
- name: "Run cargo test"
run: cargo test --all --all-features --release