Skip to content

Commit f2609d0

Browse files
committed
repo-docs: reduce duplication
1 parent c27d6a1 commit f2609d0

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,8 @@ jobs:
3333
shell: bash
3434
run: rustup update stable --no-self-update && rustup default stable
3535

36-
# Install witx cli tool
37-
- run: cargo install --path cli
38-
working-directory: tools/witx
39-
40-
- name: Check that docs reflect witx (Snapshot 1)
41-
run: witx docs --check ../../phases/snapshot/witx/wasi_snapshot_preview1.witx --output ../../phases/snapshot/docs.md
42-
working-directory: tools/witx
43-
- name: Check that docs reflect witx (Snapshot 0)
44-
run: witx docs --check ../../phases/old/snapshot_0/witx/wasi_unstable.witx --output ../../phases/old/snapshot_0/docs.md
45-
working-directory: tools/witx
46-
- name: Check that docs reflect witx (Ephemeral)
47-
run: >
48-
witx docs --check
49-
../../phases/ephemeral/witx/wasi_ephemeral_args.witx
50-
../../phases/ephemeral/witx/wasi_ephemeral_clock.witx
51-
../../phases/ephemeral/witx/wasi_ephemeral_environ.witx
52-
../../phases/ephemeral/witx/wasi_ephemeral_fd.witx
53-
../../phases/ephemeral/witx/wasi_ephemeral_path.witx
54-
../../phases/ephemeral/witx/wasi_ephemeral_poll.witx
55-
../../phases/ephemeral/witx/wasi_ephemeral_proc.witx
56-
../../phases/ephemeral/witx/wasi_ephemeral_random.witx
57-
../../phases/ephemeral/witx/wasi_ephemeral_sched.witx
58-
../../phases/ephemeral/witx/wasi_ephemeral_sock.witx
59-
--output ../../phases/ephemeral/docs.md
60-
working-directory: tools/witx
36+
- name: Check that repository docs reflect witx
37+
run: ./tools/repo_docs.sh --check
6138

6239
rustfmt:
6340
name: Rustfmt
@@ -66,5 +43,5 @@ jobs:
6643
- uses: actions/checkout@v1
6744
- name: Install Rust
6845
run: rustup update stable && rustup default stable && rustup component add rustfmt
69-
- run: cargo fmt -- --check
46+
- run: cargo fmt --all -- --check
7047
working-directory: tools/witx

tools/repo_docs.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -ex
13
cd $(dirname $(realpath $0))/witx
2-
cargo run -p witx-cli -- docs ../../phases/snapshot/witx/wasi_snapshot_preview1.witx --output ../../phases/snapshot/docs.md
3-
cargo run -p witx-cli -- docs ../../phases/old/snapshot_0/witx/wasi_unstable.witx --output ../../phases/old/snapshot_0/docs.md
4-
cargo run -p witx-cli -- docs \
4+
cargo run -p witx-cli -- docs $1 ../../phases/snapshot/witx/wasi_snapshot_preview1.witx --output ../../phases/snapshot/docs.md
5+
cargo run -p witx-cli -- docs $1 ../../phases/old/snapshot_0/witx/wasi_unstable.witx --output ../../phases/old/snapshot_0/docs.md
6+
cargo run -p witx-cli -- docs $1 \
57
../../phases/ephemeral/witx/wasi_ephemeral_args.witx \
68
../../phases/ephemeral/witx/wasi_ephemeral_clock.witx \
79
../../phases/ephemeral/witx/wasi_ephemeral_environ.witx \

0 commit comments

Comments
 (0)