-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (35 loc) · 1.36 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
name: Test and Build
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
TARGET: x86_64-unknown-linux-musl
- os: macos-latest
TARGET: x86_64-apple-darwin
- os: windows-latest
TARGET: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use cached dependencies
uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.os }}-${{ matrix.TARGET }}-${{ hashFiles('**/Cargo.lock') }}"
shared-key: "shared"
- name: Install build dependencies - Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target ${{ matrix.TARGET }} -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Building lib for ${{ matrix.os }} ${{ matrix.target }}
run: cargo build --release --no-run --locked --target ${{matrix.target}} --verbose
- name: Building tests for ${{ matrix.os }} ${{ matrix.target }}
run: cargo test --no-run --locked --target ${{matrix.target}} --verbose
- name: Running tests for ${{ matrix.os }} ${{ matrix.target }}
run: cargo test --locked --target ${{matrix.target}} --verbose