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
name: Check
on:
push:
branches:
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Documentation
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
- name: Clippy without Features
run: cargo clippy --all-targets --no-default-features -- -D warnings
- name: Test without Features
run: cargo test --workspace --no-default-features
- name: Test with heapless
run: cargo test --workspace --no-default-features --features heapless
- name: Test with alloc
run: cargo test --workspace --no-default-features --features alloc
- name: Test with std
run: cargo test --workspace --no-default-features --features std
- name: Test and Coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: AlixANNERAUD/getargs-derive
files: lcov.info
fail_ci_if_error: true
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- name: Test without Features
run: cargo test --workspace --no-default-features -- --exact --skip ui
- name: Test with all Features
run: cargo test --workspace --all-features -- --exact --skip ui
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Version consistency
run: |
metadata=$(cargo metadata --format-version 1 --no-deps)
root=$(echo "$metadata" | jq -r '.packages[] | select(.name == "getargs-derive") | .version')
macros=$(echo "$metadata" | jq -r '.packages[] | select(.name == "getargs-derive-macros") | .version')
pin=$(echo "$metadata" | jq -r '.packages[] | select(.name == "getargs-derive") | .dependencies[] | select(.name == "getargs-derive-macros") | .req')
echo "getargs-derive=$root getargs-derive-macros=$macros pin=$pin"
test "$root" = "$macros"
test "$pin" = "=$root"
- name: Package
run: cargo package --workspace