chore(cargo): update dependencies #628
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
audit: | |
name: audit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: rustsec/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all-targets --all-features -- -D warnings | |
fmt: | |
name: format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all -- --check | |
test: | |
name: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
rust: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test --all-features | |
shell-tests: | |
name: shell tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest] | |
rust: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test pipe | |
run: if ! echo "{\"a\":4}" | cargo run '"a"' | grep -q "4"; then exit 1; fi | |
- name: Test raw-string flag | |
run: if echo "{\"foo\":\"bar\"}" | cargo run '"foo"' -r | grep -q \"bar\"; then exit 1; fi | |
- name: Test heredoc | |
run: | | |
cargo run -q -- '"one"[2:0],"two","three"' <<EOF | |
{ | |
"one": [1, 2, 3], | |
"two": 2, | |
"three": 3 | |
} | |
{ | |
"one": [4, 5, 6], | |
"two": 2, | |
"three": 3 | |
} | |
EOF | |
- name: Test streaming flag | |
run: | | |
for i in {1..10}; do echo '{"foo": 2}'; sleep 1; done | cargo run '!' -s | |
- name: Test validate flag | |
run: | | |
if ! echo "{\"foo\":\"bar\"}" | cargo run -- -v | grep -q "Valid JSON file or content"; then exit 1; fi | |
if echo "{\"foo:\"bar\"}" | cargo run -- -v | grep -q "Invalid JSON file or content"; then exit 1; fi | |
- name: Test broken pipe | |
run: echo "{\"foo\":\"bar\"}" | cargo run '"foo"' | less -sex | |
- name: Test query | |
run: | | |
echo \"foo\" > selectors.txt | |
if !echo "{\"foo\":\"bar\"}" | cargo run -- -q selectors.txt | grep -q \"bar\"; then exit 1; fi | |
bench: | |
if: "!contains(github.ref, 'refs/heads/main')" | |
name: bench | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
rust: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run the benchmarks against the current branch, main and compare | |
run: | | |
git fetch origin main | |
cargo bench --bench benchmark -- --noplot --save-baseline current | |
git checkout -b main | |
cargo bench --bench benchmark -- --noplot --save-baseline main | |
cargo install critcmp --force | |
critcmp main current |