Skip to content

dep: bump the deps group across 1 directory with 2 updates (#591) #1443

dep: bump the deps group across 1 directory with 2 updates (#591)

dep: bump the deps group across 1 directory with 2 updates (#591) #1443

Workflow file for this run

name: Rust
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG: "true"
jobs:
test-gen:
uses: ./.github/workflows/test-codegen.yml
test:
name: Test matrix
runs-on: ${{ matrix.os }}
needs: test-gen
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly
target_triple:
- aarch64-unknown-linux-gnu
- i686-pc-windows-gnu
- i686-pc-windows-msvc
- i686-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
include:
- os: [self-hosted, linux, ARM64]
target_triple:
aarch64-unknown-linux-gnu
rustflags: "-C link-arg=-fuse-ld=lld --deny warnings"
- os: windows-latest
target_triple:
i686-pc-windows-gnu
# This target needs special setup with MinGW.
needs-mingw: x86
# lld on Windows uses extreme amounts of memory for debuginfo=2
rustflags: "-C link-arg=-fuse-ld=lld -C debuginfo=1 --deny warnings"
- os: windows-latest
target_triple: i686-pc-windows-msvc
# lld on Windows uses extreme amounts of memory for debuginfo=2
rustflags: "-C link-arg=-fuse-ld=lld -C debuginfo=1 --deny warnings"
- os: ubuntu-latest
target_triple:
i686-unknown-linux-gnu
# This target needs special setup.
prologue-script: sudo apt update && sudo apt install gcc-multilib
rustflags: "-C link-arg=-fuse-ld=lld --deny warnings"
- os: macos-latest
target_triple: x86_64-apple-darwin
rustflags: "--deny warnings"
- os: windows-latest
target_triple: x86_64-pc-windows-gnu
# lld on Windows uses extreme amounts of memory for debuginfo=2
rustflags: "-C link-arg=-fuse-ld=lld -C debuginfo=1 --deny warnings"
- os: windows-latest
target_triple: x86_64-pc-windows-msvc
# lld on Windows uses extreme amounts of memory for debuginfo=2
rustflags: "-C link-arg=-fuse-ld=lld -C debuginfo=1 --deny warnings"
- os: ubuntu-latest
target_triple: x86_64-unknown-linux-gnu
rustflags: "-C link-arg=-fuse-ld=lld --deny warnings"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
azure.archive.ubuntu.com:80
esm.ubuntu.com:443
motd.ubuntu.com:443
crates.io:443
index.crates.io:443
static.crates.io:443
static.rust-lang.org:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
- name: Cache restore (MinGW)
id: cache-restore-mingw
if: matrix.needs-mingw != ''
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
C:\ProgramData\chocolatey\lib\mingw
key: ${{ matrix.os }}-mingw-${{ matrix.needs-mingw }}-11-2
- name: Set up MinGW ${{ matrix.needs-mingw }}
if: matrix.needs-mingw != '' && steps.cache-restore-mingw.outputs.cache-hit != 'true'
uses: egor-tensin/setup-mingw@84c781b557efd538dec66bde06988d81cd3138cf # v2.2.0
with:
platform: ${{ matrix.needs-mingw }}
version: 12.2.0 # https://github.com/egor-tensin/setup-mingw/issues/14
- name: Add MinGW to PATH
if: matrix.needs-mingw != '' && steps.cache-restore-mingw.outputs.cache-hit == 'true'
run: echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin" >> $env:GITHUB_PATH
- name: Run prologue script
if: matrix.prologue-script != ''
run: ${{ matrix.prologue-script }}
- name: Install lld (Unix)
if: matrix.os == 'ubuntu-latest'
run: sudo apt install lld
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Rust toolchain (${{ matrix.toolchain }})
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # master
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target_triple }}
- name: Override toolchain
run: rustup override set ${{ matrix.toolchain }}
- name: Cache restore (Cargo)
id: cache-restore-cargo
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.toolchain }}-${{ matrix.target_triple }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: cargo install cargo-hack
uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # v3.1.1
with:
# Name of the crate to install
crate: cargo-hack
env:
CARGO_TARGET_DIR: target/
- name: Build all feature sets
run: cargo hack build --workspace --feature-powerset --skip default --target ${{ matrix.target_triple }} --features arbitrary --ignore-unknown-features
env:
RUSTFLAGS: ${{ matrix.rustflags }}
- name: Download rsonpath-test artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.test-gen.outputs.artifact-name }}
path: ${{ needs.test-gen.outputs.artifact-path }}
- name: Test all feature sets
run: cargo hack test --workspace --feature-powerset --skip default --target ${{ matrix.target_triple }} --features arbitrary --ignore-unknown-features
env:
RUSTFLAGS: ${{ matrix.rustflags }}
test-x86-simd:
name: Test all x86 SIMD configurations
runs-on: ubuntu-latest
needs: test-gen
strategy:
fail-fast: false
matrix:
target_triple:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
simd_override:
- avx2;fast_quotes;fast_popcnt
- ssse3;fast_quotes;fast_popcnt
- ssse3;fast_quotes;slow_popcnt
- ssse3;slow_quotes;fast_popcnt
- ssse3;slow_quotes;slow_popcnt
- sse2;fast_quotes;fast_popcnt
- sse2;fast_quotes;slow_popcnt
- sse2;slow_quotes;fast_popcnt
- sse2;slow_quotes;slow_popcnt
- nosimd;slow_quotes;slow_popcnt
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Install lld
run: sudo apt update && sudo apt install lld gcc-multilib
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # master
with:
toolchain: stable
target: ${{ matrix.target_triple }}
- name: Cache restore (Cargo)
id: cache-restore-cargo
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: stable-${{ matrix.target_triple }}-cargo-${{ hashFiles('**/Cargo.toml') }}-x86-simd
- name: Build
run: cargo build --workspace --target ${{ matrix.target_triple }}
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld --deny warnings"
- name: Download rsonpath-test artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.test-gen.outputs.artifact-name }}
path: ${{ needs.test-gen.outputs.artifact-path }}
- name: Test
run: cargo test --workspace --target ${{ matrix.target_triple }}
env:
RSONPATH_UNSAFE_FORCE_SIMD: ${{ matrix.simd_override }}
RUSTFLAGS: "-C link-arg=-fuse-ld=lld --deny warnings"
clippy:
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly
permissions:
checks: write
name: Clippy (${{ matrix.toolchain }})
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install lld
run: sudo apt update && sudo apt install lld
- name: Install Rust toolchain (${{ matrix.toolchain }})
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt
- name: Override toolchain
run: rustup override set ${{ matrix.toolchain }}
- name: Cache restore
id: cache-restore
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.toml') }}-clippy
- name: Build all features
run: cargo build --workspace --all-features --release
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld --deny warnings"
- name: Clippy all features
uses: auguwu/clippy-action@fc55104bde35cbd21451ee5830aad15c0cac8b5b # v1.3.0
with:
deny: warnings
all-features: true
token: ${{ secrets.GITHUB_TOKEN }}
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # master
with:
toolchain: nightly
- name: Override toolchain
run: rustup override set nightly
- name: Install lld
run: sudo apt install lld
- name: Cache restore
id: cache-restore
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ubuntu-latest-nightly-avx2-cargo-${{ hashFiles('**/Cargo.toml') }}-doc
- name: cargo doc (rsonpath-lib)
run: cargo doc --package rsonpath-lib --all-features --no-deps --release
env:
RUSTDOCFLAGS: "-Dwarnings --cfg docsrs"
- name: cargo doc (rsonpath-syntax)
run: cargo doc --package rsonpath-syntax --all-features --no-deps --release
env:
RUSTDOCFLAGS: "-Dwarnings --cfg docsrs"
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # master
with:
toolchain: stable
components: rustfmt
- name: Override toolchain
run: rustup override set stable
- name: Format
run: cargo fmt --package rsonpath rsonpath-lib rsonpath-syntax -- --check
cargo-deny:
name: Dependency scan (cargo-deny)
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # v2.0.1
cargo-msrv:
name: Verify MSRV (cargo-msrv)
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: cargo install cargo-msrv
uses: baptiste0928/cargo-install@904927dbe77864e0f2281519fe9d5bd097a220b3 # v3.1.1
with:
# Name of the crate to install
crate: cargo-msrv
- name: Run cargo-msrv verify on rsonpath
run: cargo msrv --path ./crates/rsonpath verify
- name: Run cargo-msrv verify on rsonpath-lib
run: cargo msrv --path ./crates/rsonpath-lib verify
- name: Run cargo-msrv verify on rsonpath-syntax
run: cargo msrv --path ./crates/rsonpath-syntax verify