Merge pull request #3313 from markusboehme/cherry-pick/1.14.x/feature… #101
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow caches crate dependencies and build artifacts for tools (except 'test-tools' since we don't use them in build workflows). | |
# The cache is only usable by workflows started from pull requests against the develop branch. | |
name: CacheDepsAndTools | |
on: | |
push: | |
branches: [1.14.x] | |
paths: | |
- '.github/**' | |
- 'sources/Cargo.lock' | |
- 'tools/buildsys/**' | |
- 'tools/pubsys*/**' | |
- '!tools/pubsys/policies/**' | |
- '!tools/pubsys/**.example' | |
- '!tools/pubsys/**.template' | |
- 'tools/Cargo.lock' | |
jobs: | |
cache: | |
if: github.repository == 'bottlerocket-os/bottlerocket' | |
runs-on: | |
group: bottlerocket | |
labels: bottlerocket_ubuntu-latest_16-core | |
continue-on-error: true | |
steps: | |
- run: | | |
echo "OS_ARCH=`uname -m`" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
# Cache `cargo-make`, `cargo-cache`, `cargo-sweep` | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }} | |
# Cache first-party code dependencies | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
.cargo | |
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('sources/Cargo.lock') }} | |
# Cache 'tools/' dependencies and build artifacts | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
tools/bin | |
tools/.crates.toml | |
tools/.crates2.json | |
tools/target | |
key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('tools/Cargo.lock') }} | |
- run: cargo install --locked --version 0.36.0 cargo-make | |
- run: cargo install --locked --version 0.8.3 --no-default-features --features ci-autoclean cargo-cache | |
- run: cargo install --locked --version 0.6.2 cargo-sweep | |
- run: | | |
cargo sweep -i -r tools/ | |
cargo sweep -t 7 -r tools/ | |
- run: cargo make publish-setup-tools | |
- run: cargo make publish-tools | |
- run: cargo make build-tools | |
# This cleans the cargo cache in ~/.cargo | |
- run: cargo-cache |