Skip to content

Commit

Permalink
👷 migrate to dtolnay/rust-toolchain + mozilla-actions/sccache-action
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Nov 5, 2024
1 parent d3e2087 commit b3029bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
permissions:
contents: read

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
build:
runs-on: ${{ matrix.os.imageName }}
Expand Down Expand Up @@ -47,12 +51,11 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust_toolchain }}
target: ${{ matrix.os.target_platform }}
override: true
profile: ${{ matrix.os.profile_rustup }}
targets: ${{ matrix.os.target_platform }}
- uses: mozilla-actions/sccache-action@v0.0.6
- uses: davidB/rust-cargo-make@v1
- name: Run tests
run: cargo make --disable-check-for-updates --profile "${{ matrix.os.profile_ci_flow }}" ci-flow
Expand All @@ -63,6 +66,8 @@ jobs:
CARGO_MAKE_RUN_CODECOV: "false"
# to have CODECOV_TOKEN go to https://codecov.io/gh/${GITHUB_USER}/${GITHUB_REPO}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: ${SCCACHE_PATH} --show-stats
shell: bash

integration:
# Integration tests are linux only
Expand All @@ -77,14 +82,9 @@ jobs:
# Anonymous access is limited to 60 requests / hour / worker
# github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.6
- name: Run on k3d
run: cargo run
- run: ${SCCACHE_PATH} --show-stats
shell: bash
22 changes: 9 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
permissions:
contents: write

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
build:
runs-on: ${{ matrix.os.imageName }}
Expand All @@ -37,21 +41,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust_toolchain }}
target: ${{ matrix.os.target_platform }}
override: true
profile: minimal
targets: ${{ matrix.os.target_platform }}
- uses: mozilla-actions/sccache-action@v0.0.6
- uses: davidB/rust-cargo-make@v1
- name: Make zip-release-ci-flow
id: zip-release-ci-flow
Expand All @@ -71,6 +65,8 @@ jobs:
tag: ${{ steps.zip-release-ci-flow.outputs.dist_version }}
prerelease: false # ${{ github.ref == format('refs/tags/{0}', steps.zip-release-ci-flow.outputs.dist_version) }}
overwrite: true
- run: ${SCCACHE_PATH} --show-stats
shell: bash

krew-update:
needs: [build]
Expand Down

0 comments on commit b3029bd

Please sign in to comment.