-
Notifications
You must be signed in to change notification settings - Fork 29
82 lines (70 loc) · 2.34 KB
/
rust.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
name: Rust
on:
push:
branches: [ master, dev-v2 ]
pull_request:
branches: [ master, dev-v2 ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows, netbsd]
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
target: x86_64-apple-darwin
- build: windows
os: windows-latest
target: x86_64-pc-windows-msvc
- build: netbsd
os: ubuntu-22.04
target: x86_64-unknown-netbsd
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Use Cross
shell: bash
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
- 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: cargo test
if: ${{ !startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose ${{ env.TARGET_FLAGS }}
- name: cargo test (without chrono)
if: ${{ !startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose --no-default-features --features coinit_apartmentthreaded ${{ env.TARGET_FLAGS }}
- name: cargo test
if: ${{ startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose ${{ env.TARGET_FLAGS }}
- name: cargo test (without chrono)
if: ${{ startsWith(matrix.build, 'netbsd') }}
run: ${{ env.CARGO }} test --verbose --no-default-features --features coinit_apartmentthreaded ${{ env.TARGET_FLAGS }}
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings