-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
73 lines (66 loc) · 4.01 KB
/
Copy pathaction.yml
File metadata and controls
73 lines (66 loc) · 4.01 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
name: "Setup CI caches"
description: "Caches Maven dependencies, generated-client build outputs, Playwright browsers, and Storybook builds."
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
id: java
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: Restore Maven dependencies
if: github.event_name == 'pull_request' && (startsWith(inputs.cache-type, 'application-server-') || contains(fromJSON('["webapp-e2e", "server-contracts"]'), inputs.cache-type))
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.m2/repository
key: ${{ inputs.os }}-maven-${{ hashFiles('server/**/pom.xml', 'server/.mvn/extensions.xml', 'server/.mvn/wrapper/maven-wrapper.properties') || 'no-pom' }}
restore-keys: |
${{ inputs.os }}-maven-
- name: Cache Maven dependencies
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) && (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', 'server/.mvn/extensions.xml', 'server/.mvn/wrapper/maven-wrapper.properties') || 'no-pom' }}
restore-keys: |
${{ inputs.os }}-maven-
- name: Restore generated clients
if: github.event_name == 'pull_request' && (startsWith(inputs.cache-type, 'application-server-') || contains(fromJSON('["webapp-e2e", "server-contracts"]'), inputs.cache-type))
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.m2/build-cache
key: ${{ inputs.os }}-${{ steps.java.outputs.distribution }}-${{ steps.java.outputs.version }}-generated-clients-${{ hashFiles('server/pom.xml', 'server/generated-clients/pom.xml', 'server/.mvn/**', 'server/generated-clients/src/**') }}
- name: Cache generated clients
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) && (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/build-cache
key: ${{ inputs.os }}-${{ steps.java.outputs.distribution }}-${{ steps.java.outputs.version }}-generated-clients-${{ hashFiles('server/pom.xml', 'server/generated-clients/pom.xml', 'server/.mvn/**', 'server/generated-clients/src/**') }}
- 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-
- name: Cache Storybook build
if: contains(fromJSON('["webapp-visual", "webapp-storybook"]'), inputs.cache-type)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
webapp/storybook-static
webapp/.storybook/.cache
key: ${{ inputs.os }}-storybook-${{ hashFiles('webapp/**/*.stories.tsx', 'webapp/.storybook/**', 'pnpm-lock.yaml') }}
restore-keys: |
${{ inputs.os }}-storybook-