-
Notifications
You must be signed in to change notification settings - Fork 93
98 lines (84 loc) · 2.21 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
name: Continuous Integration
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
- staging
- trying
jobs:
# NOTE all these jobs need to be added to the `needs` section of the ci-* jobs!
build:
name: build
strategy:
matrix:
os:
- ubuntu-20.04
target:
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.target }}
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.os == 'ubuntu-20.04' }}
command: build
args: --target ${{ matrix.target }} --locked
- name: Run
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.os == 'ubuntu-20.04' }}
command: run
args: --target ${{ matrix.target }} -- -V
test:
name: test
strategy:
matrix:
toolchain:
- nightly
# Don't remove this target; test coverage in `smoke.rs` relies on us
# running at least one pinned toolchain.
- nightly-2021-08-01
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
components: rust-src
toolchain: ${{ matrix.toolchain }}
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
# bors.tech integration
ci-success:
name: ci
if: ${{ success() }}
needs:
- build
- test
runs-on: ubuntu-20.04
steps:
- name: CI succeeded
run: exit 0