-
Notifications
You must be signed in to change notification settings - Fork 36
77 lines (71 loc) · 2.62 KB
/
_verify_examples.yml
File metadata and controls
77 lines (71 loc) · 2.62 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Verify/Examples
permissions:
contents: read
on:
workflow_call:
jobs:
examples:
runs-on: ubuntu-24.04
steps:
- uses: envoyproxy/toolshed/actions/bind-mounts@598eacce15ab5f208102a2fd5669292868002701 # v0.4.0
with:
mounts: |
- src: /mnt/docker
target: /var/lib/docker
rm: true
command-pre: sudo systemctl stop docker
command-post: sudo systemctl start docker
- src: /mnt/runner-cache
target: /home/runner/.cache
chown: "runner:runner"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: |
TEMPDIR=/cache/docker
sudo mkdir -p "${TEMPDIR}"
sudo mount -t tmpfs none "$TEMPDIR"
sudo chown runner "$TEMPDIR"
- uses: actions/cache/restore@v5
id: cache
with:
path: /cache/docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile*') }}
- run: |
TEMPDIR=/cache/docker
sudo mkdir -p /var/lib/docker-examples
zstd --stdout -d "${TEMPDIR}/docker.tar.zst" | sudo tar --warning=no-timestamp -xf - -C /var/lib/docker-examples
sudo umount "$TEMPDIR"
if: steps.cache.outputs.cache-hit == 'true'
- run: |
TEMPDIR=/cache/docker
sudo mkdir -p "${TEMPDIR}"
sudo mount -t tmpfs none "$TEMPDIR"
sudo chown runner "$TEMPDIR"
sudo du -ch /var/lib/docker | grep total
sudo du -ch /var/lib/docker-examples | grep total
sudo df -h
- uses: actions/cache@v5
with:
path: /home/runner/.cache
key: ${{ runner.os }}-bazel-${{ hashFiles('**/BUILD', '**/*bzl', 'WORKSPACE') }}
- run: |
docker pull envoyproxy/envoy:dev
DEV_CONTAINER_ID=$(docker inspect --format='{{.Id}}' envoyproxy/envoy:dev)
echo "DEV_CONTAINER_ID=${DEV_CONTAINER_ID}" >> $GITHUB_ENV
- run: |
export UID
echo "common --config=ci" >> repo.bazelrc
docker compose run --quiet --quiet-pull --quiet-build examples
env:
DOCKER_BUILDKIT: 1
COMPOSE_BAKE: true
BUILDKIT_PROGRESS: quiet
- run: |
TEMPDIR=/cache/docker
sudo tar cf - -C /var/lib/docker-examples . | zstd - -q -T0 -o "${TEMPDIR}/docker.tar.zst"
ls -alh "${TEMPDIR}/docker.tar.zst"
if: steps.cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request'
- uses: actions/cache/save@v5
if: steps.cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request'
with:
path: /cache/docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile*') }}