-
Notifications
You must be signed in to change notification settings - Fork 9
61 lines (61 loc) · 2.09 KB
/
cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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-kernel-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
# Delete packages that aren't needed for other builds.
- run: |
find build/rpms -name '*debugsource*' -type f -print -delete
find build/rpms -name '*debuginfo*' -type f -print -delete
find build/rpms -name '*kmod*nvidia*' -type f -print -delete
# Remove the previous cache (if it exists).
- run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ env.cache-key }}" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
# 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 }}