Skip to content

Commit 38ffdfe

Browse files
committed
edoc ebiv
1 parent 0ab565f commit 38ffdfe

File tree

7 files changed

+41
-2
lines changed

7 files changed

+41
-2
lines changed

.github/workflows/chromium-headful-image.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ jobs:
2929
NAME: ci-chromium-headful
3030
DETACH: "true"
3131
SERVICE_EXCEPTIONS: pulseaudio
32+
CACHE_DIR: .buildx-cache-headful-${{ matrix.runner }}
3233
steps:
3334
- name: Checkout
3435
uses: actions/checkout@v4
3536

37+
- name: Restore Docker layer cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.CACHE_DIR }}
41+
key: buildx-${{ runner.os }}-${{ matrix.runner }}-headful-${{ hashFiles('images/chromium-headful/Dockerfile', 'images/chromium-headful/wrapper.sh', 'images/chromium-headful/client/package.json', 'images/chromium-headful/client/package-lock.json', 'server/go.mod', 'server/go.sum') }}
42+
restore-keys: |
43+
buildx-${{ runner.os }}-${{ matrix.runner }}-headful-
44+
3645
- name: Build image
3746
shell: bash
3847
run: |

.github/workflows/chromium-headless-image.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ jobs:
2929
NAME: ci-chromium-headless
3030
DETACH: "true"
3131
SERVICE_EXCEPTIONS: pulseaudio
32+
CACHE_DIR: .buildx-cache-headless-${{ matrix.runner }}
3233
steps:
3334
- name: Checkout
3435
uses: actions/checkout@v4
3536

37+
- name: Restore Docker layer cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.CACHE_DIR }}
41+
key: buildx-${{ runner.os }}-${{ matrix.runner }}-headless-${{ hashFiles('images/chromium-headless/image/Dockerfile', 'images/chromium-headless/image/wrapper.sh', 'server/go.mod', 'server/go.sum') }}
42+
restore-keys: |
43+
buildx-${{ runner.os }}-${{ matrix.runner }}-headless-
44+
3645
- name: Build image
3746
shell: bash
3847
run: |

.github/workflows/server-test.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
timeout-minutes: 45
1818
permissions:
1919
contents: read
20+
env:
21+
CACHE_DIR: .buildx-cache-${{ runner.os }}-${{ runner.arch }}
2022

2123
steps:
2224
- name: Checkout code
@@ -29,6 +31,8 @@ jobs:
2931
uses: actions/setup-node@v4
3032
with:
3133
node-version: 22
34+
cache: pnpm
35+
cache-dependency-path: server/e2e/playwright/pnpm-lock.yaml
3236

3337
- name: Set up pnpm
3438
uses: pnpm/action-setup@v4
@@ -41,6 +45,14 @@ jobs:
4145
go-version-file: "server/go.mod"
4246
cache: true
4347

48+
- name: Restore Docker layer cache
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.CACHE_DIR }}
52+
key: buildx-${{ runner.os }}-${{ runner.arch }}-e2e-${{ hashFiles('images/**/Dockerfile', 'images/**/wrapper.sh', 'images/chromium-headful/client/package.json', 'images/chromium-headful/client/package-lock.json', 'server/go.mod', 'server/go.sum') }}
53+
restore-keys: |
54+
buildx-${{ runner.os }}-${{ runner.arch }}-e2e-
55+
4456
- name: Build chromium-headless image
4557
shell: bash
4658
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ lerna-debug.log*
1313
# Caches
1414

1515
.cache
16+
.buildx-cache-*
1617

1718
# Diagnostic reports (https://nodejs.org/api/report.html)
1819

images/chromium-headful/build-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ source ../../shared/start-buildkit.sh
1010

1111
# Build the Docker image using the repo root as build context
1212
# so the Dockerfile's first stage can access the server sources
13-
(cd "$SCRIPT_DIR/../.." && docker build -f images/chromium-headful/Dockerfile -t "$IMAGE" .)
13+
(cd "$SCRIPT_DIR/../.." && docker build -f images/chromium-headful/Dockerfile "${CACHE_ARGS[@]}" -t "$IMAGE" .)

images/chromium-headless/build-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ source ../../shared/start-buildkit.sh
1010

1111
# Build the Docker image using the repo root as build context
1212
# so the Dockerfile's first stage can access the server sources
13-
(cd "$SCRIPT_DIR/../.." && docker build -f images/chromium-headless/image/Dockerfile -t "$IMAGE" .)
13+
(cd "$SCRIPT_DIR/../.." && docker build -f images/chromium-headless/image/Dockerfile "${CACHE_ARGS[@]}" -t "$IMAGE" .)

shared/start-buildkit.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ else
2121
docker start buildkit
2222
return $?
2323
fi
24+
25+
CACHE_ARGS=()
26+
if [ -n "${CACHE_DIR:-}" ]; then
27+
mkdir -p "$CACHE_DIR"
28+
CACHE_ARGS+=(--cache-from type=local,src="$CACHE_DIR")
29+
CACHE_ARGS+=(--cache-to type=local,dest="$CACHE_DIR",mode=max)
30+
fi
31+
export CACHE_ARGS

0 commit comments

Comments
 (0)