Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust GitHub Actions for Ubuntu 24.04. #297

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P ubuntu-24.04=catthehacker/ubuntu:act-24.04
102 changes: 51 additions & 51 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
jobs:

licenses:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
Expand All @@ -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
Expand All @@ -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 //...
Expand All @@ -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)
Expand All @@ -98,7 +100,7 @@ jobs:
git diff --exit-code

msrv:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

env:
RUSTFLAGS: -D warnings
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -436,7 +445,7 @@ jobs:
-c envoy.yaml

reactors:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
matrix:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -505,15 +514,6 @@ jobs:
- name: Format (manifest)
run: cargo verify-project

- name: Run cargo audit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this PR removes auditing for both examples + reactors (though keeps the SDK itself cargo audited). Is that intended? If so, could you leave a comment as to express this happened and indicate that it is unnecessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same reasoning as to why they were excluded in local tests in #280 (i.e. the cost of building those tools doesn't provide too much value in examples, so it's not worth building them if they're not pre-installed as in full ubuntu-22.04 images on GitHub Actions).

With that in mind, I moved them to the audit and outdated jobs, since we build those tools for the SDK already.

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
Expand Down
Loading