Skip to content

Commit b9f539e

Browse files
committed
feat(ci): add workflow
1 parent 3d77d15 commit b9f539e

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
RUST_BACKTRACE: 1
11+
CI: 1
12+
13+
jobs:
14+
style:
15+
name: Check Style
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: stable
22+
components: rustfmt,clippy
23+
profile: minimal
24+
25+
- name: cargo fmt -- --check
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: fmt
29+
args: -- --check
30+
31+
test:
32+
name: Test ${{ matrix.name }}
33+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
34+
needs: [style]
35+
36+
strategy:
37+
matrix:
38+
name:
39+
- linux / stable
40+
- linux / beta
41+
- linux / nightly
42+
- macos / stable
43+
- windows / stable-x86_64-msvc
44+
- windows / stable-i686-msvc
45+
- windows / stable-x86_64-gnu
46+
- windows / stable-i686-gnu
47+
include:
48+
- name: linux / stable
49+
- name: linux / beta
50+
rs_toolchain: beta
51+
- name: linux / nightly
52+
rs_toolchain: nightly
53+
54+
- name: macos / stable
55+
os: macos-latest
56+
57+
- name: windows / stable-x86_64-msvc
58+
os: windows-latest
59+
rs_target: x86_64-pc-windows-msvc
60+
- name: windows / stable-i686-msvc
61+
os: windows-latest
62+
rs_target: i686-pc-windows-msvc
63+
- name: windows / stable-x86_64-gnu
64+
os: windows-latest
65+
rs_target: x86_64-pc-windows-gnu
66+
- name: windows / stable-i686-gnu
67+
os: windows-latest
68+
rs_target: i686-pc-windows-gnu
69+
70+
steps:
71+
- uses: actions/checkout@v2
72+
- uses: actions-rs/toolchain@v1
73+
with:
74+
toolchain: ${{ matrix.rs_toolchain || 'stable' }}
75+
target: ${{ matrix.rs_target }}
76+
profile: minimal
77+
78+
- name: cargo build
79+
uses: actions-rs/cargo@v1
80+
with:
81+
command: build
82+
83+
- name: cargo test -- --test-threads 1
84+
uses: actions-rs/cargo@v1
85+
with:
86+
command: test
87+
args: -- --test-threads 1
88+
89+
docs:
90+
name: Docs
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- uses: actions/checkout@v2
95+
- uses: actions-rs/toolchain@v1
96+
with:
97+
toolchain: stable
98+
profile: minimal
99+
100+
- name: Check Documentation
101+
env:
102+
RUSTDOCFLAGS: -D warnings
103+
uses: actions-rs/cargo@v1
104+
with:
105+
command: doc
106+
args: --no-deps --all-features

0 commit comments

Comments
 (0)