Skip to content

Commit 5f93ff7

Browse files
authored
Merge pull request #57 from joshrotenberg/chore/github-actions-ci
ci: migrate from Travis CI to GitHub Actions
2 parents ddf01c0 + e11eb69 commit 5f93ff7

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test (${{ matrix.rust }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
rust: [stable, beta, nightly]
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust ${{ matrix.rust }}
24+
uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
28+
- name: Cache dependencies
29+
uses: Swatinem/rust-cache@v2
30+
with:
31+
workspaces: |
32+
jmespath
33+
jmespath-cli
34+
35+
- name: Build jmespath
36+
run: cargo build --manifest-path jmespath/Cargo.toml
37+
38+
- name: Test jmespath
39+
run: cargo test --manifest-path jmespath/Cargo.toml
40+
41+
- name: Test jmespath with specialized feature (nightly only)
42+
if: matrix.rust == 'nightly'
43+
run: cargo test --manifest-path jmespath/Cargo.toml --features specialized
44+
45+
- name: Build jmespath-cli
46+
run: cargo build --manifest-path jmespath-cli/Cargo.toml
47+
48+
- name: Test jmespath-cli
49+
run: cargo test --manifest-path jmespath-cli/Cargo.toml
50+
51+
clippy:
52+
name: Clippy
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Install Rust stable
58+
uses: dtolnay/rust-toolchain@stable
59+
with:
60+
components: clippy
61+
62+
- name: Cache dependencies
63+
uses: Swatinem/rust-cache@v2
64+
with:
65+
workspaces: |
66+
jmespath
67+
jmespath-cli
68+
69+
- name: Run clippy on jmespath
70+
run: cargo clippy --manifest-path jmespath/Cargo.toml -- -D warnings
71+
72+
- name: Run clippy on jmespath-cli
73+
run: cargo clippy --manifest-path jmespath-cli/Cargo.toml -- -D warnings
74+
75+
fmt:
76+
name: Rustfmt
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Install Rust stable
82+
uses: dtolnay/rust-toolchain@stable
83+
with:
84+
components: rustfmt
85+
86+
- name: Check formatting
87+
run: |
88+
cargo fmt --manifest-path jmespath/Cargo.toml -- --check
89+
cargo fmt --manifest-path jmespath-cli/Cargo.toml -- --check
90+
91+
bench:
92+
name: Benchmarks
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Install Rust nightly
98+
uses: dtolnay/rust-toolchain@nightly
99+
100+
- name: Cache dependencies
101+
uses: Swatinem/rust-cache@v2
102+
with:
103+
workspaces: jmespath
104+
105+
- name: Run benchmarks
106+
run: cargo bench --manifest-path jmespath/Cargo.toml --no-run

0 commit comments

Comments
 (0)