-
Notifications
You must be signed in to change notification settings - Fork 6
119 lines (116 loc) · 3.71 KB
/
ci.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
on:
push:
branches: [ main, auto, canary ]
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- name: Lint (clippy) async-std
uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-default-features --features async-std-runtime --all-targets
- name: Lint (clippy) tokio
uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-default-features --features async-tokio-runtime --all-targets
- name: Lint (clippy) default
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets
- name: Lint (rustfmt)
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
rust-version: [ stable ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
# Checkout the code
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
override: true
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
# cargo build
- name: Build all targets with default features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets
- name: Build all targets with async-std
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --no-default-features --features async-std-runtime
- name: Build all targets with tokio
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --no-default-features --features async-tokio-runtime
- name: Test async-std with cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --no-default-features --features async-std-runtime
- name: Test tokio with cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --no-default-features --features async-tokio-runtime
- name: Test defaults with cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
# cargo nextest
- name: Install nextest from crates.io
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-nextest
- name: Test async-std with nextest from crates.io
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --no-default-features --features async-std-runtime
- name: Test tokio with nextest from crates.io
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --no-default-features --features async-tokio-runtime
- name: Test defaults with nextest from crates.io
uses: actions-rs/cargo@v1
with:
command: nextest
args: run