-
-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (54 loc) · 2.23 KB
/
dev-crates.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
name: dev-crates
on:
push:
paths:
- 'crates/**'
branches-ignore:
- 'master'
jobs:
test:
name: crates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- uses: taiki-e/install-action@nextest
- name: crates/types lint
# add packages as args to -p option
run: |
cargo fmt -p pg -p types -p httpclient -- --check
cargo clippy -p pg -p types -p httpclient -- -Dwarnings
working-directory: crates/types
- name: install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: crates/types unit tests
# add packages as args to -p option
run: cargo test -p pg -p types -p httpclient
- name: crates/types coverage report and fail coverage under ${{ env.MIN_CODE_COV }}%
run: |
make rust-coverage RUST_PKG=types
echo "MIN_CODE_COV=$(yq .crates.types.min_code_cov project.yaml)" >> $GITHUB_ENV
echo "CURR_CODE_COV=$(make rust-coverage-percent RUST_PKG=types)" >> $GITHUB_ENV
if [[ ${{ env.CURR_CODE_COV }} -lt ${{ env.MIN_CODE_COV }} ]]; then
echo 'coverage dropped below ${{ env.MIN_CODE_COV }}: ${{ env.CURR_CODE_COV }}%'
exit 1
fi
- name: crates/pg coverage report and fail coverage under ${{ env.MIN_CODE_COV }}%
run: |
make rust-coverage RUST_PKG=pg
echo "MIN_CODE_COV=$(yq .crates.pg.min_code_cov project.yaml)" >> $GITHUB_ENV
if [[ ${{ env.CURR_CODE_COV }} -lt ${{ env.MIN_CODE_COV }} ]]; then
echo 'coverage dropped below ${{ env.MIN_CODE_COV }}: ${{ env.CURR_CODE_COV }}%'
exit 1
fi
- name: crates/httpclient coverage report and fail coverage under ${{ env.MIN_CODE_COV }}%
run: |
make rust-coverage RUST_PKG=httpclient
echo "MIN_CODE_COV=$(yq .crates.httpclient.min_code_cov project.yaml)" >> $GITHUB_ENV
if [[ ${{ env.CURR_CODE_COV }} -lt ${{ env.MIN_CODE_COV }} ]]; then
echo 'coverage dropped below ${{ env.MIN_CODE_COV }}: ${{ env.CURR_CODE_COV }}%'
exit 1
fi