Skip to content

Merge pull request #10 from bcressey/delete-cache-before-save #8

Merge pull request #10 from bcressey/delete-cache-before-save

Merge pull request #10 from bcressey/delete-cache-before-save #8

Workflow file for this run

# This workflow caches external dependencies, build tools, and the most recent artifacts.
# The cache is only usable by workflows started from pull requests against the develop branch.
name: CacheLatest
on:
push:
branches: [develop]
jobs:
cache:
if: github.repository == 'bottlerocket-os/bottlerocket-core-kit'
runs-on:
group: bottlerocket
labels: bottlerocket_ubuntu-latest_32-core
concurrency:
group: cache-${{ github.ref }}
cancel-in-progress: true
env:
cache-key: build-cache
permissions:
actions: write
steps:
- uses: actions/checkout@v4
# Install dependencies for twoliter and cargo-make.
- run: sudo apt -y install build-essential openssl libssl-dev pkg-config liblz4-tool
shell: bash
# Install cargo-make.
- run: cargo install cargo-make
shell: bash
# This installs twoliter.
- run: make prep
# This fetches any external kit dependencies.
- run: make fetch
# This fetches Rust crate and Go module dependencies.
- run: make twoliter fetch
# This builds the current packages and kits.
- run: make ARCH=x86_64
- run: make ARCH=aarch64
# Remove the previous cache.
- run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ env.cache-key }}" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This caches the reusable artifacts for future CI runs.
- uses: actions/cache/save@v4
# Save Rust dependencies
with:
path: |
~/.cargo
.cargo
.gomodcache
build/external-kits
build/rpms
build/state
target
key: ${{ env.cache-key }}