Skip to content

Commit f68d472

Browse files
committed
Fix the example, expand workflows
1 parent ee3ca81 commit f68d472

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

.github/workflows/rust.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,44 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
910

11+
- name: Build
12+
run: cargo build --workspace --examples --verbose
13+
14+
- name: Run tests
15+
run: cargo test --workspace --verbose
16+
17+
- name: Run simple_example
18+
run: cargo run --package argh --example simple_example two --fooey
19+
20+
rustfmt:
21+
name: rustfmt
22+
runs-on: ubuntu-latest
1023
steps:
1124
- uses: actions/checkout@v2
25+
1226
- name: Run Rustfmt
1327
run: cargo fmt -- --check
14-
- name: Build
15-
run: cargo build --verbose
16-
- name: Run tests
17-
run: cargo test --verbose
28+
29+
clippy:
30+
name: clippy
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v2
34+
1835
- name: Run clippy
19-
run: cargo clippy --version && cargo clippy -- -D warnings
20-
- name: Run cargo expand
21-
run: (rustup default nightly && cd argh && cargo install cargo-expand && cargo expand --example simple_example.rs)
36+
run: cargo clippy --version && cargo clippy --tests --workspace -- -D warnings
37+
38+
docs:
39+
name: docs
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v1
43+
44+
- name: Check documentation
45+
env:
46+
RUSTDOCFLAGS: -D warnings
47+
run: cargo doc --no-deps --document-private-items --workspace

argh/examples/simple_example.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ struct SubCommandTwo {
3636
fooey: bool,
3737
}
3838

39-
fn main() {}
39+
fn main() {
40+
let toplevel: TopLevel = argh::from_env();
41+
println!("{:#?}", toplevel);
42+
}

0 commit comments

Comments
 (0)