-
Notifications
You must be signed in to change notification settings - Fork 35
132 lines (123 loc) · 3.36 KB
/
linter-testing-lib.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: "Testing library: Format, lint, build, and test"
# This job runs:
# - rustfmt
# - rustdoc
# - clippy linting
# - tests
# for the smart contract testing library.
on:
push:
branches: main
pull_request:
branches: main
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- 'contract-testing/**/*.rs'
- 'contract-testing/**/*.toml'
- 'rustfmt.toml'
- 'concordium-rust-sdk'
- 'concordium-std-derive'
workflow_dispatch: # allows manual trigger
env:
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu
RUST_CLIPPY: 1.73
jobs:
"lint_fmt":
name: ${{ matrix.build-dir }} lint:fmt
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_FMT }}
override: true
components: rustfmt
- name: Format
working-directory: ${{ matrix.build-dir }}
run: |
cargo fmt -- --color=always --check
"lint_doc":
name: ${{ matrix.build-dir }} lint:doc
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_CLIPPY }}
override: true
- name: Docs
working-directory: ${{ matrix.build-dir }}
run: |
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --color=always
"lint_clippy":
name: ${{ matrix.build-dir }} lint:clippy
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_CLIPPY }}
override: true
components: clippy
- name: Clippy
working-directory: ${{ matrix.build-dir }}
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
cargo clippy --color=always --tests --benches -- -Dclippy::all
"cargo_test":
name: ${{ matrix.build-dir }} cargo:test
runs-on: ubuntu-latest
needs: "lint_fmt"
strategy:
matrix:
build-dir:
- 'contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_CLIPPY }}
override: true
- name: Test
working-directory: ${{ matrix.build-dir }}
run: cargo test -- --skip io_tests # Skip the I/O tests in the testing library.