-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.78 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
57
58
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
name: Test
jobs:
dump-ctx:
name: Context
runs-on: ubuntu-latest
steps:
- name: Dump Github context
uses: crazy-max/ghaction-dump-context@v2
build-and-release:
name: Build and Test
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-musl, os: linux, arch: amd64, runner: ubuntu-latest, cross: false }
- { target: x86_64-apple-darwin, os: darwin, arch: amd64, runner: macos-latest, cross: false }
- { target: x86_64-pc-windows-msvc, os: windows, arch: amd64, runner: windows-latest, cross: false }
runs-on: ${{ matrix.job.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
if: not ${{ matrix.job.cross }}
- name: Install Cross Compiler
if: matrix.job.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools gcc-multilib
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
toolchain: 1.76.0
components: rust-src,rust-docs,rustfmt,clippy
- name: Setup Cache
uses: Swatinem/[email protected]
with:
shared-key: "build-${{ matrix.job.target }}"
- name: Build
run: |
cargo build --locked --release --target ${{ matrix.job.target }}
- name: Test
run: |
cargo test --locked --release --target ${{ matrix.job.target }}
- name: Format
run: |
cargo fmt --check
- name: Clippy
run: |
cargo clippy --no-deps -- -Dwarnings -Dunused-crate-dependencies