Skip to content

Commit ac37793

Browse files
authored
Add CI (#1)
* Coverage * Added generic checks
1 parent c2f43e4 commit ac37793

File tree

2 files changed

+141
-0
lines changed

2 files changed

+141
-0
lines changed

.github/workflows/generic.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
name: Generic checks
10+
11+
jobs:
12+
check:
13+
name: Check
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v2
18+
19+
- name: Install stable toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: stable
24+
override: true
25+
26+
- name: Run cargo check
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: check
30+
31+
test:
32+
name: Test Suite
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout sources
36+
uses: actions/checkout@v2
37+
38+
- name: Install stable toolchain
39+
uses: actions-rs/toolchain@v1
40+
with:
41+
profile: minimal
42+
toolchain: stable
43+
override: true
44+
45+
- name: Run cargo test
46+
uses: actions-rs/cargo@v1
47+
with:
48+
command: test
49+
50+
lints:
51+
name: Lints
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout sources
55+
uses: actions/checkout@v2
56+
57+
- name: Install stable toolchain
58+
uses: actions-rs/toolchain@v1
59+
with:
60+
profile: minimal
61+
toolchain: stable
62+
override: true
63+
components: rustfmt, clippy
64+
65+
- name: Run cargo fmt
66+
uses: actions-rs/cargo@v1
67+
with:
68+
command: fmt
69+
args: --all -- --check
70+
71+
- name: Run cargo clippy
72+
uses: actions-rs/cargo@v1
73+
with:
74+
command: clippy
75+
args: -- -D warnings

.github/workflows/grcov.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
name: Code coverage with grcov
10+
11+
jobs:
12+
grcov:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Install toolchain
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: nightly
22+
override: true
23+
profile: minimal
24+
25+
- name: Execute tests
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: test
29+
args: --all
30+
env:
31+
CARGO_INCREMENTAL: 0
32+
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
33+
34+
# Note that `actions-rs/grcov` Action can install `grcov` too,
35+
# but can't use faster installation methods yet.
36+
# As a temporary experiment `actions-rs/install` Action plugged in here.
37+
# Consider **NOT** to copy that into your workflow,
38+
# but use `actions-rs/grcov` only
39+
- name: Pre-installing grcov
40+
uses: actions-rs/[email protected]
41+
with:
42+
crate: grcov
43+
use-tool-cache: true
44+
45+
- name: Gather coverage data
46+
id: coverage
47+
uses: actions-rs/[email protected]
48+
with:
49+
coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
50+
51+
- name: Coveralls upload
52+
uses: coverallsapp/github-action@master
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
parallel: true
56+
path-to-lcov: ${{ steps.coverage.outputs.report }}
57+
58+
grcov_finalize:
59+
runs-on: ubuntu-latest
60+
needs: grcov
61+
steps:
62+
- name: Coveralls finalization
63+
uses: coverallsapp/github-action@master
64+
with:
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
parallel-finished: true

0 commit comments

Comments
 (0)