-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
45 lines (42 loc) · 1.92 KB
/
Copy pathaction.yml
File metadata and controls
45 lines (42 loc) · 1.92 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
name: "Setup CI caches"
description: "Caches Maven dependencies and Playwright browsers. Node/pnpm setup happens in the calling workflow."
inputs:
cache-type:
description: "Type of cache to setup"
required: true
os:
description: "Operating system for cache key"
required: false
default: "ubuntu-latest"
runs:
using: "composite"
steps:
- name: Set up JDK 21
if: startsWith(inputs.cache-type, 'application-server-') || contains(fromJSON('["webapp-e2e", "server-contracts"]'), inputs.cache-type)
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: "temurin"
java-version: "21"
- name: Cache Maven repo
# server/target/generated-sources is deliberately NOT cached. actions/cache's
# restore-keys fallback can restore a stale generated-sources tree from a prior
# build (e.g., from before a Java package rename); the `quick` profile in pom.xml
# then activates on the present directory and skips codegen, causing compile
# failures because the cached classes don't match the current sources. Codegen
# runs in ~5s — much cheaper than that failure mode.
if: startsWith(inputs.cache-type, 'application-server-') || contains(fromJSON('["webapp-e2e", "server-contracts"]'), inputs.cache-type)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.m2/repository
key: ${{ inputs.os }}-maven-${{ hashFiles('server/pom.xml') || 'no-pom' }}
restore-keys: |
${{ inputs.os }}-maven-
- name: Cache Playwright browsers
if: inputs.cache-type == 'webapp-storybook'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: ${{ inputs.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ inputs.os }}-playwright-