-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 2.12 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
59
60
61
62
on:
pull_request:
branches: [ master ]
env:
CARGO_INCREMENTAL: 0
name: test
jobs:
test:
name: unit + integration tests (${{ matrix.runner }}, ${{ matrix.toolchain }}, ${{ matrix.target }}, ${{ matrix.async-feature }})
runs-on: ${{ matrix.runner }}
strategy:
matrix:
toolchain: [1.65.0, stable, beta, nightly]
runner: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin]
async-feature: [async,async-rustls]
exclude:
# don't run async for musl builds
- target: x86_64-unknown-linux-musl
async-feature: async
# don't run async-rustls on macOS to limit parallel macOS jobs
- runner: macos-latest
async-feature: async-rustls
# don't run when target <-> runner pair is invalid
- target: x86_64-apple-darwin
runner: ubuntu-latest
- target: x86_64-unknown-linux-gnu
runner: macos-latest
- target: x86_64-unknown-linux-musl
runner: macos-latest
steps:
- if: matrix.target == 'x86_64-unknown-linux-musl'
name: Add musl dependencies
run: |
set -ex
sudo apt-get update
sudo apt-get install -y musl-tools
- uses: actions/checkout@v3
- id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
components: rustfmt
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Build tests
run: cargo test --no-default-features --features "sync image ${{ matrix.async-feature }}" --target ${{ matrix.target }} --no-run --lib
- name: Test
run: |
cargo test --no-default-features --features "sync image ${{ matrix.async-feature }}" --target ${{ matrix.target }} --lib
cargo test --no-default-features --features "sync image ${{ matrix.async-feature }}" --target ${{ matrix.target }} --doc