Skip to content

Commit 76bd6a0

Browse files
committed
Add more tests to continuous integration
Cherry-picking reasonable checks from https://github.com/jj-vcs/jj/blob/main/.github/workflows/ci.yml
1 parent a20095b commit 76bd6a0

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99

1010
jobs:
1111
test:
12+
name: build and test
1213
runs-on: ubuntu-latest
1314
steps:
1415
- uses: actions/checkout@v4
@@ -18,3 +19,45 @@ jobs:
1819
run: cargo build --verbose
1920
- name: Test
2021
run: cargo test --verbose
22+
23+
check-rustfmt:
24+
name: check (rustfmt)
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dtolnay/rust-toolchain@stable
29+
with:
30+
toolchain: nightly
31+
components: rustfmt
32+
- run: cargo +nightly fmt --all -- --check
33+
34+
check-clippy:
35+
name: check (clippy)
36+
permissions:
37+
checks: write
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: dtolnay/rust-toolchain@stable
42+
with:
43+
toolchain: stable
44+
components: clippy
45+
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
46+
47+
check-doctests:
48+
name: check (doctests)
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: dtolnay/rust-toolchain@stable
53+
# NOTE: We need to run `cargo test --doc` separately from normal tests:
54+
# - `cargo build --all-targets` specifies: "Build all targets"
55+
# - `cargo test --all-targets` specifies: "Test all targets (does not include doctests)"
56+
- name: Run doctests
57+
run: cargo test --workspace --doc
58+
env:
59+
RUST_BACKTRACE: 1
60+
- name: Check `cargo doc` for lint issues
61+
env:
62+
RUSTDOCFLAGS: "--deny warnings"
63+
run: cargo doc --workspace --no-deps

0 commit comments

Comments
 (0)