Skip to content

Commit

Permalink
chore: move cache around (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeeshan Lakhani authored Oct 11, 2023
1 parent b0bda83 commit edd2f21
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 73 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ 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

- 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:
Expand Down Expand Up @@ -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

Expand All @@ -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}}

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
86 changes: 45 additions & 41 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }}
Expand All @@ -105,19 +109,19 @@ 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:
cache-on-failure: true
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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions release-plz.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit edd2f21

Please sign in to comment.