Skip to content

Commit 7067d50

Browse files
committed
Migrate CI to GitHub Actions
1 parent 2d89994 commit 7067d50

File tree

6 files changed

+187
-322
lines changed

6 files changed

+187
-322
lines changed

.github/workflows/tests.yml

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: master
8+
9+
env:
10+
CARGO_INCREMENTAL: 0
11+
RUSTFLAGS: "-Dwarnings"
12+
13+
jobs:
14+
check-doc:
15+
name: Doc deadlinks
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Install toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: nightly
24+
override: true
25+
- run: cargo install cargo-deadlinks
26+
- run: cargo deadlinks -- --features custom
27+
28+
main-tests:
29+
name: Main tests
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
os: [ubuntu-latest, macos-latest, windows-latest]
34+
toolchain: [nightly, beta, stable, 1.34]
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Install toolchain
38+
uses: actions-rs/toolchain@v1
39+
with:
40+
profile: minimal
41+
toolchain: ${{ matrix.toolchain }}
42+
override: true
43+
- run: cargo test
44+
- run: cargo test --features std
45+
- if: ${{ matrix.toolchain == 'nightly' }}
46+
run: cargo build --benches
47+
48+
linux-tests:
49+
name: Additional Linux targets
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
target: [
54+
x86_64-unknown-linux-musl,
55+
i686-unknown-linux-gnu,
56+
i686-unknown-linux-musl,
57+
]
58+
steps:
59+
- uses: actions/checkout@v2
60+
- name: Install toolchain
61+
uses: actions-rs/toolchain@v1
62+
with:
63+
profile: minimal
64+
target: ${{ matrix.target }}
65+
toolchain: stable
66+
override: true
67+
- run: sudo apt install gcc-multilib
68+
- run: cargo test --target ${{ matrix.target }}
69+
70+
windows-tests:
71+
name: Additional Windows targets
72+
runs-on: windows-latest
73+
strategy:
74+
matrix:
75+
toolchain: [
76+
stable-x86_64-gnu,
77+
stable-i686-gnu,
78+
stable-i686-msvc,
79+
]
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Install toolchain
83+
uses: actions-rs/toolchain@v1
84+
with:
85+
profile: minimal
86+
toolchain: ${{ matrix.toolchain }}
87+
override: true
88+
- run: cargo test
89+
90+
cross-tests:
91+
name: Cross tests
92+
runs-on: ${{ matrix.os }}
93+
strategy:
94+
matrix:
95+
include:
96+
- os: ubuntu-latest
97+
target: mips-unknown-linux-gnu
98+
toolchain: stable
99+
steps:
100+
- uses: actions/checkout@v2
101+
- name: Install toolchain
102+
uses: actions-rs/toolchain@v1
103+
with:
104+
profile: minimal
105+
target: ${{ matrix.target }}
106+
toolchain: ${{ matrix.toolchain }}
107+
override: true
108+
- name: Cache cargo plugins
109+
uses: actions/cache@v1
110+
with:
111+
path: ~/.cargo/bin/
112+
key: ${{ runner.os }}-cargo-plugins
113+
- name: Install cross
114+
run: cargo install cross || true
115+
- name: Test
116+
run: cross test --no-fail-fast --target ${{ matrix.target }}
117+
118+
build:
119+
name: Build-only
120+
runs-on: ubuntu-latest
121+
strategy:
122+
matrix:
123+
target: [
124+
x86_64-sun-solaris,
125+
x86_64-unknown-freebsd,
126+
x86_64-fuchsia,
127+
x86_64-unknown-netbsd,
128+
x86_64-unknown-redox,
129+
x86_64-fortanix-unknown-sgx,
130+
]
131+
steps:
132+
- uses: actions/checkout@v2
133+
- name: Install toolchain
134+
uses: actions-rs/toolchain@v1
135+
with:
136+
profile: minimal
137+
target: ${{ matrix.target }}
138+
toolchain: nightly
139+
components: rust-src
140+
override: true
141+
- run: cargo build --target ${{ matrix.target }}
142+
143+
build-rdrand:
144+
name: Build-only RDRAND
145+
runs-on: ubuntu-latest
146+
steps:
147+
- uses: actions/checkout@v2
148+
- name: Install toolchain
149+
uses: actions-rs/toolchain@v1
150+
with:
151+
profile: minimal
152+
toolchain: nightly
153+
components: rust-src
154+
override: true
155+
- name: Cache cargo plugins
156+
uses: actions/cache@v1
157+
with:
158+
path: ~/.cargo/bin/
159+
key: ${{ runner.os }}-cargo-plugins
160+
- name: Install xbuild
161+
run: cargo install cargo-xbuild || true
162+
- name: CloudABI
163+
run: cargo xbuild --features=rdrand --target x86_64-unknown-cloudabi
164+
- name: UEFI
165+
run: cargo xbuild --features=rdrand --target x86_64-unknown-uefi
166+
- name: Hermit
167+
run: cargo xbuild --features=rdrand --target x86_64-unknown-hermit
168+
- name: L4Re
169+
run: cargo xbuild --features=rdrand --target x86_64-unknown-l4re-uclibc
170+
- name: VxWorks
171+
run: cargo xbuild --features=rdrand --target x86_64-wrs-vxworks
172+
173+
clippy-fmt:
174+
name: Clippy + rustfmt
175+
runs-on: ubuntu-latest
176+
steps:
177+
- uses: actions/checkout@v1
178+
- uses: actions-rs/toolchain@v1
179+
with:
180+
profile: minimal
181+
toolchain: stable
182+
components: rustfmt, clippy
183+
- name: clippy
184+
run: cargo clippy --all -- -D warnings
185+
- name: fmt
186+
run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)