From edd2f2115915f17cc4f5d8cbca383b823b7a1d82 Mon Sep 17 00:00:00 2001 From: Zeeshan Lakhani Date: Tue, 10 Oct 2023 20:56:11 -0400 Subject: [PATCH] chore: move cache around (#374) --- .github/workflows/builds.yml | 24 +++---- .github/workflows/coverage.yml | 18 +++--- .github/workflows/release.yml | 9 +-- .github/workflows/tests_and_checks.yml | 86 ++++++++++++++------------ release-plz.toml | 8 +-- 5 files changed, 72 insertions(+), 73 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index e23ecd3e..c8db6236 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -46,12 +46,6 @@ jobs: run: sudo apt update && sudo apt install -y musl-dev musl-tools if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl' - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ matrix.target }}-${{ matrix.os }} - - name: Install Rust Toolchain id: toolchain uses: dtolnay/rust-toolchain@stable @@ -59,6 +53,12 @@ jobs: - name: Override rust-toolchain.toml run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: check-${{ matrix.target }}-${{ matrix.os }} + - name: cross-build uses: taiki-e/setup-cross-toolchain-action@v1 with: @@ -88,12 +88,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ env.LINUX_TARGET }}-ubuntu-latest - - name: Install musl-tools run: sudo apt update && sudo apt install -y musl-dev musl-tools @@ -107,6 +101,12 @@ jobs: with: tool: cargo-generate-rpm + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: check-${{ env.LINUX_TARGET }}-ubuntu-latest + - name: Create .deb run: cargo deb -p homestar-runtime --target ${{env.LINUX_TARGET}} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5658f422..aba21811 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -53,15 +53,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.3 - - name: Use mold-linker uses: rui314/setup-mold@v1 @@ -72,6 +63,15 @@ jobs: - name: Override rust-toolchain.toml run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + save-if: ${{ github.event_name == 'push' }} + + - name: Sccache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6b3f75e..41468e38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,16 +44,11 @@ jobs: fetch-depth: 0 token: ${{ steps.generate-token.outputs.token }} - - name: Cache Project - uses: Swatinem/rust-cache@v2 - - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@stable - - name: Verify Publishing of crates - uses: katyo/publish-crates@v2 - with: - dry-run: true + - name: Cache Project + uses: Swatinem/rust-cache@v2 - name: Run release-plz uses: MarcoIeni/release-plz-action@v0.5 diff --git a/.github/workflows/tests_and_checks.yml b/.github/workflows/tests_and_checks.yml index 1f6db2c5..f6788cca 100644 --- a/.github/workflows/tests_and_checks.yml +++ b/.github/workflows/tests_and_checks.yml @@ -60,18 +60,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - # Smarter caching action, speeds up build times compared to regular cache: - # https://github.com/Swatinem/rust-cache - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ matrix.rust-toolchain }}-${{ matrix.os }} - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.3 - - name: Use mold-linker if: ${{ matrix.os == 'ubuntu-latest' }} uses: rui314/setup-mold@v1 @@ -86,12 +74,28 @@ jobs: - name: Override rust-toolchain.toml run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: check-${{ matrix.rust-toolchain }}-${{ matrix.os }} + save-if: ${{ github.event_name == 'push' }} + + - name: Sccache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Check Format run: cargo fmt --all -- --check - name: Run Linter run: cargo clippy --all -- -D warnings + - name: Verify Publishing of crates + uses: katyo/publish-crates@v2 + if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }} + with: + dry-run: true + # Only "test" release build on push event. - name: Test Release if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }} @@ -105,6 +109,12 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Use mold-linker + uses: rui314/setup-mold@v1 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + - name: Cache Project uses: Swatinem/rust-cache@v2 with: @@ -112,12 +122,6 @@ jobs: shared-key: deny-stable-ubuntu-latest save-if: ${{ github.event_name == 'push' }} - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - # Check for security advisories - name: Check Advisories uses: EmbarkStudios/cargo-deny-action@v1 @@ -153,16 +157,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: test-all-${{ matrix.rust-toolchain }}-${{ matrix.os }} - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.3 - - name: Use mold-linker if: ${{ matrix.os == 'ubuntu-latest' }} uses: rui314/setup-mold@v1 @@ -176,6 +170,16 @@ jobs: - name: Override rust-toolchain.toml run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: test-all-${{ matrix.rust-toolchain }}-${{ matrix.os }} + save-if: ${{ github.event_name == 'push' }} + + - name: Sccache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Install nextest uses: taiki-e/install-action@nextest @@ -211,13 +215,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: test-all-${{ matrix.rust-toolchain }}-windows-latest - save-if: ${{ github.event_name == 'push' }} - - name: Install Rust Toolchain id: toolchain uses: dtolnay/rust-toolchain@master @@ -227,6 +224,13 @@ jobs: - name: Override rust-toolchain.toml run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Cache Project + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: test-all-${{ matrix.rust-toolchain }}-windows-latest + save-if: ${{ github.event_name == 'push' }} + - name: Install nextest uses: taiki-e/install-action@nextest @@ -255,6 +259,12 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Use mold-linker + uses: rui314/setup-mold@v1 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + - name: Cache Project uses: Swatinem/rust-cache@v2 with: @@ -264,12 +274,6 @@ jobs: - name: Sccache uses: mozilla-actions/sccache-action@v0.0.3 - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - - name: Run Doc(s) compilation env: RUSTDOCFLAGS: -Dwarnings diff --git a/release-plz.toml b/release-plz.toml index afe748b6..51643147 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -1,34 +1,34 @@ [workspace] -publish = false changelog_update = false +publish = false pr_labels = ["release"] [[package]] name = "homestar-core" publish = true changelog_update = true -git_release_enable = true [[package]] name = "homestar-runtime" publish = true changelog_update = true -git_release_enable = true [[package]] name = "homestar-wasm" publish = true changelog_update = true -git_release_enable = true [[package]] name = "homestar-functions-add" publish = false +changelog_update = false [[package]] name = "homestar-functions-test" publish = false +changelog_update = false [[package]] name = "example-websocket-relay" publish = false +changelog_update = false