diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 660011767..f7c0ac95e 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -10,11 +10,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@stable + - uses: actions-rust-lang/audit@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fcc92c4f..eb4e728fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@v2 with: - override: true - toolchain: stable - profile: minimal + tool: ripgrep # Smart caching for Rust projects. # Includes workaround for macos cache corruption. # - https://github.com/rust-lang/cargo/issues/8603 @@ -96,42 +95,35 @@ jobs: # Run `cargo check` on our minimum supported Rust version runs-on: ubuntu-latest steps: - - uses: actions/checkout@main - - name: Find MSRV - id: msrv - run: | - MSRV=$(grep MSRV README.md | grep -oE "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+") - echo $MSRV - echo "msrv=${MSRV}" >> $GITHUB_OUTPUT - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ steps.msrv.outputs.msrv }} - profile: minimal - override: true - - uses: Swatinem/rust-cache@v2 - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace - - - name: Check rust-version keys matches advertised MSRV - run: | - if ! cat Cargo.toml | grep "rust-version" | grep "${{ steps.msrv.outputs.msrv }}"; then - echo "msrv policy inconsistent with rust-version key" - exit 1 - fi - - - name: Check devcontainer matches MSRV - run: | - versions=$(sed -nE 's|^FROM (.*/)?rust:([^ ]+)|\2|p' .devcontainer/Dockerfile) - echo "Versions: $versions" - mismatches=$(echo "$versions" | grep -v '^${{ steps.msrv.outputs.msrv }}' || true) - echo "Mismatches: $mismatches" - if [ -n "$mismatches" ]; then - echo "::error ::Devcontainer includes incorrect rust version(s): $mismatches" - exit 1 - fi + - uses: actions/checkout@v4 + - name: Find MSRV + id: msrv + run: | + MSRV=$(grep MSRV README.md | grep -oE "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+") + echo $MSRV + echo "msrv=${MSRV}" >> $GITHUB_OUTPUT + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.msrv.outputs.msrv }} + - uses: Swatinem/rust-cache@v2 + - name: Check + run: cargo check --workspace + - name: Check rust-version keys matches advertised MSRV + run: | + if ! cat Cargo.toml | grep "rust-version" | grep "${{ steps.msrv.outputs.msrv }}"; then + echo "msrv policy inconsistent with rust-version key" + exit 1 + fi + - name: Check devcontainer matches MSRV + run: | + versions=$(sed -nE 's|^FROM (.*/)?rust:([^ ]+)|\2|p' .devcontainer/Dockerfile) + echo "Versions: $versions" + mismatches=$(echo "$versions" | grep -v '^${{ steps.msrv.outputs.msrv }}' || true) + echo "Mismatches: $mismatches" + if [ -n "$mismatches" ]; then + echo "::error ::Devcontainer includes incorrect rust version(s): $mismatches" + exit 1 + fi integration: runs-on: ubuntu-latest @@ -143,11 +135,7 @@ jobs: k8s: [v1.26, v1.30] steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - override: true - toolchain: stable - profile: minimal + - uses: dtolnay/rust-toolchain@stable # Smart caching for Rust projects. # Includes workaround for macos cache corruption. # - https://github.com/rust-lang/cargo/issues/8603 @@ -201,11 +189,7 @@ jobs: exit 1 fi - - uses: actions-rs/toolchain@v1 - with: - override: true - toolchain: stable - profile: minimal + - uses: dtolnay/rust-toolchain@stable # Smart caching for Rust projects. # Includes workaround for macos cache corruption. # - https://github.com/rust-lang/cargo/issues/8603 diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 3e4864341..493b22fc4 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -11,12 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly components: clippy - override: true - - uses: actions-rs/clippy-check@v1 + - uses: clechasseur/rs-clippy-check@v3 with: - args: "--workspace" - token: ${{ secrets.GITHUB_TOKEN }} + args: --workspace diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index deddadbcf..5843e63f6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,12 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1.0.7 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly components: rustfmt - override: true - - name: Run rustfmt - id: rustfmt - run: rustfmt +nightly --edition 2018 --check $(find . -type f -iname *.rs) + - run: rustfmt +nightly --edition 2018 --check $(find . -type f -iname *.rs) diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 7a1ae4a44..aca386a00 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -13,18 +13,11 @@ jobs: rustfmt_nightly: runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Install nightly toolchain with rustfmt available - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - override: true components: rustfmt - - run: rustfmt +nightly --edition 2018 $(find . -type f -iname *.rs) - - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: diff --git a/justfile b/justfile index cbe33338f..3ba5c4d14 100644 --- a/justfile +++ b/justfile @@ -52,7 +52,7 @@ coverage: hack: time cargo hack check --feature-powerset --no-private -p kube \ --skip=oauth,oidc \ - --group-features=socks5,http-proxy,gzip \ + --group-features=socks5,http-proxy,gzip,ws \ --group-features=admission,jsonpatch,derive \ --group-features=rustls-tls,aws-lc-rs # Test groups features with minimal overlap that are grouped to reduce combinations.