Skip to content

Commit

Permalink
Move away from deprecated actions-rs (#1620)
Browse files Browse the repository at this point in the history
* Move away from deprecated actions-rs

in favour of various other actions.

- fix indent
- fix rg ignored check
- add one more hack grouping (hack job takes 25m now...)

Signed-off-by: clux <[email protected]>

* undo all-features

Signed-off-by: clux <[email protected]>

* components?

Signed-off-by: clux <[email protected]>

---------

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux authored Oct 26, 2024
1 parent 2fbcbbe commit 568c4df
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 81 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
84 changes: 34 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 2 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 2 additions & 9 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 568c4df

Please sign in to comment.