From 05346f92134a3780aa8204a6f6196c46ed972060 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Thu, 24 Oct 2024 11:20:59 +0300 Subject: [PATCH 1/2] Stop using umaintained actions from actions-rs The functionality should stay similar. Note that GitHub does have some tools installed already (like rustfmt) outside of rustup so it's a little unclear which versions cargo ends up using... Again, situation should remain same as it was with actions-rs. Signed-off-by: Jussi Kukkonen --- .../auto-publish-crates-upon-release.yml | 10 +-- .github/workflows/conformance.yml | 15 ++-- .github/workflows/tests.yml | 89 ++++++++----------- 3 files changed, 48 insertions(+), 66 deletions(-) diff --git a/.github/workflows/auto-publish-crates-upon-release.yml b/.github/workflows/auto-publish-crates-upon-release.yml index f7a498a5e6..fc40829b6c 100644 --- a/.github/workflows/auto-publish-crates-upon-release.yml +++ b/.github/workflows/auto-publish-crates-upon-release.yml @@ -7,11 +7,11 @@ jobs: publish-automatically: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - toolchain: stable - override: true + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Rustup + run: | + rustup install stable + rustup override set stable - name: publish crates run: cargo publish --token ${{ secrets.CARGO_API_TOKEN }} diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 536f5b9dcd..aaad6e4c63 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -7,15 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: build - args: --manifest-path=tests/conformance/Cargo.toml + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + - run: | + cargo build --manifest-path=tests/conformance/Cargo.toml - uses: sigstore/sigstore-conformance@main with: entrypoint: ${{ github.workspace }}/tests/conformance/target/debug/sigstore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3799017e35..643e3e3671 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,56 +8,47 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: check + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + - run: | + cargo check check-wasm: name: Check WASM runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - target: wasm32-unknown-unknown - override: true - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: check - args: --no-default-features --features wasm + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + rustup target add wasm32-unknown-unknown + - run: | + cargo check --no-default-features --features wasm test: name: Test Suite runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: test - args: --workspace --features full-native-tls,test-registry + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + - run: | + cargo test --workspace --features full-native-tls,test-registry doc: name: Build Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: nightly - override: true + - name: Rustup (nightly) + run: | + rustup install --profile minimal nightly + rustup override set nightly - run: | make doc @@ -66,29 +57,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: fmt - args: --all -- --check + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + rustup component add rustfmt + - run: | + cargo fmt --all -- --check clippy: name: Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 - with: - command: clippy - args: --workspace -- -D warnings + - name: Rustup + run: | + rustup install --profile minimal stable + rustup override set stable + rustup component add clippy + - run: | + cargo clippy --workspace -- -D warnings From dc31a17e95265490deb24a83919c5e7e5fc5c4d4 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Thu, 24 Oct 2024 11:42:02 +0300 Subject: [PATCH 2/2] Use an action for caching dependencies Use caching everywhere to avoid downloads and dependency compiles. As an exception, avoid this during publish to make sure cache poisoning is never an issue). Signed-off-by: Jussi Kukkonen --- .github/workflows/conformance.yml | 1 + .github/workflows/tests.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index aaad6e4c63..0a60130715 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -11,6 +11,7 @@ jobs: run: | rustup install --profile minimal stable rustup override set stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo build --manifest-path=tests/conformance/Cargo.toml - uses: sigstore/sigstore-conformance@main diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 643e3e3671..bbd3f5b4d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,7 @@ jobs: run: | rustup install --profile minimal stable rustup override set stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo check @@ -25,6 +26,7 @@ jobs: rustup install --profile minimal stable rustup override set stable rustup target add wasm32-unknown-unknown + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo check --no-default-features --features wasm @@ -37,6 +39,7 @@ jobs: run: | rustup install --profile minimal stable rustup override set stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo test --workspace --features full-native-tls,test-registry @@ -49,6 +52,7 @@ jobs: run: | rustup install --profile minimal nightly rustup override set nightly + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | make doc @@ -62,6 +66,7 @@ jobs: rustup install --profile minimal stable rustup override set stable rustup component add rustfmt + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo fmt --all -- --check @@ -75,5 +80,6 @@ jobs: rustup install --profile minimal stable rustup override set stable rustup component add clippy + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - run: | cargo clippy --workspace -- -D warnings