Skip to content

Commit af51fbb

Browse files
hovinenbcopybara-github
authored andcommitted
Split the check job of the CI action into separate jobs.
The test, integration test, and doc jobs can then run in parallel, which should speed up the CI process. This also: * includes tests against the stable, nightly, and beta channels as well as the minimal supported Rust version 1.67.0, * removes the redundant build step, and * adds a clippy job. PiperOrigin-RevId: 523967002
1 parent 9f47da5 commit af51fbb

File tree

1 file changed

+70
-12
lines changed

1 file changed

+70
-12
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,77 @@ env:
1616
CARGO_TERM_COLOR: always
1717

1818
jobs:
19-
build:
2019

20+
clippy:
2121
runs-on: ubuntu-latest
22+
name: clippy / ${{ matrix.toolchain }}
23+
permissions:
24+
contents: read
25+
checks: write
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
toolchain: [stable, beta]
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Install ${{ matrix.toolchain }}
33+
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
34+
with:
35+
toolchain: ${{ matrix.toolchain }}
36+
components: clippy
37+
- name: cargo clippy
38+
uses: actions-rs/clippy-check@v1.0.7
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
42+
test:
43+
runs-on: ubuntu-latest
44+
name: test / ubuntu / ${{ matrix.toolchain }}
45+
strategy:
46+
matrix:
47+
toolchain: [stable, 1.67.0, nightly, beta]
48+
steps:
49+
- uses: actions/checkout@v3
50+
- name: Install ${{ matrix.toolchain }}
51+
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
52+
with:
53+
toolchain: ${{ matrix.toolchain }}
54+
- name: cargo generate-lockfile
55+
if: hashFiles('Cargo.lock') == ''
56+
run: cargo generate-lockfile
57+
- name: cargo test --locked
58+
run: cargo test --locked --all-features
2259

60+
integration-test:
61+
runs-on: ubuntu-latest
62+
name: integration-test / ubuntu / ${{ matrix.toolchain }}
63+
strategy:
64+
matrix:
65+
toolchain: [stable, 1.67.0, nightly, beta]
66+
steps:
67+
- uses: actions/checkout@v3
68+
- name: Install ${{ matrix.toolchain }}
69+
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
70+
with:
71+
toolchain: ${{ matrix.toolchain }}
72+
- name: cargo generate-lockfile
73+
if: hashFiles('Cargo.lock') == ''
74+
run: cargo generate-lockfile
75+
- name: run_integration_tests.sh
76+
run: /bin/bash ./run_integration_tests.sh
77+
78+
doc:
79+
runs-on: ubuntu-latest
80+
name: doc / nightly
2381
steps:
24-
- uses: actions/checkout@v3
25-
- name: Build
26-
run: cargo build --verbose
27-
- name: Run tests
28-
run: cargo test --verbose
29-
- name: Run integration tests
30-
run: /bin/bash ./run_integration_tests.sh
31-
- name: Check documentation
32-
env:
33-
RUSTDOCFLAGS: -D warnings
34-
run: cargo doc
82+
- uses: actions/checkout@v3
83+
with:
84+
submodules: true
85+
- name: Install nightly
86+
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
87+
with:
88+
toolchain: nightly
89+
- name: cargo doc
90+
run: cargo doc --no-deps --all-features
91+
env:
92+
RUSTDOCFLAGS: -D warnings

0 commit comments

Comments
 (0)