-
Notifications
You must be signed in to change notification settings - Fork 50
86 lines (81 loc) · 2.59 KB
/
cross-platform-testing.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: cross-platform-testing
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-release:
name: test
runs-on: ${{ matrix.os }}
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_FLAGS:
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
strategy:
matrix:
build: [ linux, linux-arm, macos, win-msvc, win-gnu, win32-gnu, win32-msvc ]
include:
- build: linux
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-musl
- build: linux-arm
os: ubuntu-latest
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: win-msvc
os: windows-2019
rust: stable
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-2019
rust: stable
target: x86_64-pc-windows-gnu
- build: win32-gnu
os: windows-latest
rust: stable
target: i686-pc-windows-gnu
- build: win32-msvc
os: windows-latest
rust: stable
target: i686-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
components: rustfmt, clippy
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Build with all features
if: startsWith(matrix.os, 'windows')
run: ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --all-features
- name: Build (and link)
run: ${{ env.CARGO }} build ${{ env.TARGET_FLAGS }}
- name: Run tests
run: ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }}
- name: Run fmt
run: ${{ env.CARGO }} fmt ${{ env.TARGET_FLAGS }} --all -- --check
- name: Run clippy
run: ${{ env.CARGO }} clippy ${{ env.TARGET_FLAGS }}