-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (51 loc) · 1.82 KB
/
prime-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
---
name: Prime Cache
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
jobs:
prime-docker-cache:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: ["cpp", "rust"]
steps:
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
if: matrix.flavor == 'cpp'
id: buildkit-cache
with:
path: root-ccache
key: buildkit-cache-${{ github.run_id }}
restore-keys: |
buildkit-cache
- uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3.1.2
if: matrix.flavor == 'cpp'
with:
cache-map: |
{
"root-ccache": "/root/.ccache"
}
skip-extraction: ${{ steps.buildkit-cache.outputs.cache-hit }}
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: .devcontainer/${{ matrix.flavor }}/Dockerfile
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=${{ github.repository }}-${{ matrix.flavor }}
cache-to: type=gha,mode=max,scope=${{ github.repository }}-${{ matrix.flavor }}
prime-xwin-cache:
runs-on: ubuntu-latest
steps:
- run: |
set -Eeuo pipefail
mkdir test
docker run --rm --mount type=bind,src="$(pwd)/test",dst=/ws -w /ws ghcr.io/${{ github.repository }}-cpp:latest xwin --accept-license splat --preserve-ms-arch-notation
- uses: actions/cache/save@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: test/.xwin-cache
key: xwin-cache-${{ github.run_id }}