-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.18 KB
/
main.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
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on any pushes to any branch
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly with rustfmt
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Install stable with clippy
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Format Check
#run cargo fmt to fix if in violation
run: cargo +nightly fmt -- --check
- name: Clippy Linting
# --all-targets means apply to test code too. Without it just applies to application code
run: cargo clippy --all-targets -p purl -- -D warnings
- name: Regenerate test suite
run: cargo xtask codegen
- name: Ensure no changes to test suite
run: |
git diff --exit-code -- purl_test
- name: Check docs
run: RUSTDOCFLAGS="-D warnings" cargo xtask doc -p purl --no-deps
test:
strategy:
matrix:
include:
- name: Minimal
runner: test
args: -p purl --no-default-features
- name: Default
runner: test
args: -p purl
- name: Full
runner: tarpaulin
args: --all-features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable with clippy
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install tarpaulin
if: ${{ matrix.runner == 'tarpaulin' }}
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://github.com/xd009642/tarpaulin/releases/download/0.25.1/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz > tarpaulin.tar.gz
printf 'd3f687ffc0c30ee1e7e5ea63f58b4fb770ce38f6d97d1afca340846ed783de85 tarpaulin.tar.gz' | sha256sum -c || exit 1
mkdir -p ~/.cargo/bin
tar -xzf tarpaulin.tar.gz -C ~/.cargo/bin
rm tarpaulin.tar.gz
- name: Run tests
run: cargo ${{ matrix.runner }} ${{ matrix.args }}