-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust GitHub Actions for Ubuntu 24.04. (#297)
GitHub migrated `ubuntu-latest` to `ubuntu-24.04`, which comes with a different set of pre-installed software. Most notably, both cargo audit and outdated tools are missing. While there, pin runner image and tools to specific versions. Signed-off-by: Piotr Sikora <[email protected]>
- Loading branch information
1 parent
1ce09fd
commit c1485d3
Showing
2 changed files
with
52 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-P ubuntu-24.04=catthehacker/ubuntu:act-24.04 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ on: | |
jobs: | ||
|
||
licenses: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -46,14 +46,17 @@ jobs: | |
~/go/pkg/mod | ||
key: licenses-${{ hashFiles('.github/workflows/rust.yml') }} | ||
|
||
- name: Check licenses | ||
- name: Install dependencies | ||
run: | | ||
go install github.com/google/addlicense@latest | ||
go install github.com/google/addlicense@v1.1.1 | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
- name: Check licenses | ||
run: | | ||
addlicense -check -ignore "bazel/cargo/remote/**" . | ||
bazel: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -73,12 +76,13 @@ jobs: | |
~/.cargo/bin | ||
~/.cargo/registry | ||
~/go/pkg/mod | ||
key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} | ||
key: bazel-${{ hashFiles('.github/workflows/rust.yml', 'BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} | ||
|
||
- name: Install dependencies | ||
if: ${{ env.ACT }} | ||
run: | | ||
go install github.com/bazelbuild/[email protected] | ||
go install github.com/bazelbuild/[email protected] | ||
go install github.com/bazelbuild/buildtools/[email protected] | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
- name: Build (wasm32-unknown-unknown) | ||
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //... | ||
|
@@ -88,8 +92,6 @@ jobs: | |
|
||
- name: Format (buildifier) | ||
run: | | ||
go install github.com/bazelbuild/buildtools/buildifier@latest | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
buildifier -mode=check -r . | ||
- name: Format (rules_rust) | ||
|
@@ -98,7 +100,7 @@ jobs: | |
git diff --exit-code | ||
msrv: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
env: | ||
RUSTFLAGS: -D warnings | ||
|
@@ -120,7 +122,7 @@ jobs: | |
**/target | ||
key: msrv-${{ hashFiles('Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -161,7 +163,7 @@ jobs: | |
run: cargo publish --dry-run --target=wasm32-unknown-unknown | ||
|
||
stable: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
env: | ||
RUSTFLAGS: -D warnings | ||
|
@@ -183,7 +185,7 @@ jobs: | |
**/target | ||
key: stable-${{ hashFiles('Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -223,7 +225,7 @@ jobs: | |
run: cargo publish --dry-run --target=wasm32-unknown-unknown | ||
|
||
nightly: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
env: | ||
RUSTFLAGS: -D warnings | ||
|
@@ -245,7 +247,7 @@ jobs: | |
**/target | ||
key: nightly-${{ hashFiles('Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -286,13 +288,12 @@ jobs: | |
run: cargo publish --dry-run --target=wasm32-unknown-unknown | ||
|
||
outdated: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache | ||
if: ${{ env.ACT }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
|
@@ -302,9 +303,9 @@ jobs: | |
~/.cargo/bin | ||
~/.cargo/registry | ||
~/.rustup | ||
key: outdated-${{ hashFiles('Cargo.toml') }} | ||
key: outdated-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -313,20 +314,28 @@ jobs: | |
rm rustup-init.sh | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
- name: Run cargo outdated | ||
- name: Install dependencies | ||
run: | | ||
cargo install cargo-outdated --version 0.16.0 | ||
- name: Run cargo outdated (main) | ||
run: | | ||
# TODO: Switch back to the official version once it supports Cargo lockfile v4. | ||
cargo install --git https://github.com/MonterraByte/cargo-outdated.git --branch cargo-update | ||
cargo outdated --root-deps-only --exit-code 1 | ||
- name: Run cargo outdated (examples) | ||
run: | | ||
for example in $(find examples -name Cargo.toml); do \ | ||
cd $(dirname $GITHUB_WORKSPACE/$example); \ | ||
cargo outdated --root-deps-only --exit-code 1; \ | ||
done | ||
audit: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache | ||
if: ${{ env.ACT }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
|
@@ -336,26 +345,35 @@ jobs: | |
~/.cargo/bin | ||
~/.cargo/registry | ||
~/.rustup | ||
key: audit-${{ hashFiles('Cargo.toml') }} | ||
key: audit-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
chmod +x ./rustup-init.sh | ||
./rustup-init.sh -y | ||
rm rustup-init.sh | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
export PATH=$PATH:$HOME/.cargo/bin | ||
cargo install cargo-audit | ||
- name: Run cargo audit | ||
- name: Install dependencies | ||
run: | | ||
cargo install cargo-audit --version 0.21.0 | ||
- name: Run cargo audit (main) | ||
run: | | ||
cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock | ||
cargo audit | ||
- name: Run cargo audit (examples) | ||
run: | | ||
for example in $(find examples -name Cargo.toml); do \ | ||
cd $(dirname $GITHUB_WORKSPACE/$example); \ | ||
cargo audit; \ | ||
done | ||
examples: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
strategy: | ||
matrix: | ||
|
@@ -391,7 +409,7 @@ jobs: | |
**/target | ||
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -417,15 +435,6 @@ jobs: | |
- name: Format (manifest) | ||
run: cargo verify-project | ||
|
||
- name: Run cargo audit | ||
if: ${{ !env.ACT }} | ||
run: cargo audit | ||
|
||
# TODO: Re-enable once cargo outdated supports Cargo lockfile v4. | ||
#- name: Run cargo outdated | ||
# if: ${{ !env.ACT }} | ||
# run: cargo outdated --root-deps-only --exit-code 1 | ||
|
||
- name: Validate Envoy config | ||
run: | | ||
docker run --rm \ | ||
|
@@ -436,7 +445,7 @@ jobs: | |
-c envoy.yaml | ||
reactors: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
strategy: | ||
matrix: | ||
|
@@ -472,7 +481,7 @@ jobs: | |
**/target | ||
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
- name: Install Rustup | ||
if: ${{ env.ACT }} | ||
run: | | ||
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh | ||
|
@@ -505,15 +514,6 @@ jobs: | |
- name: Format (manifest) | ||
run: cargo verify-project | ||
|
||
- name: Run cargo audit | ||
if: ${{ !env.ACT }} | ||
run: cargo audit | ||
|
||
# TODO: Re-enable once cargo outdated supports Cargo lockfile v4. | ||
#- name: Run cargo outdated | ||
# if: ${{ !env.ACT }} | ||
# run: cargo outdated --root-deps-only --exit-code 1 | ||
|
||
- name: Rename .wasm to match expected filename | ||
run: | | ||
cd target/wasm32-wasip1/release | ||
|