Skip to content

Commit e83d337

Browse files
committed
ci: cache SDK generator and Maven dependencies
1 parent ee5cca2 commit e83d337

1 file changed

Lines changed: 29 additions & 5 deletions

File tree

.github/workflows/generated-conformance.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,57 @@ name: Generated SDK Conformance
22

33
on:
44
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "**/*.md"
58
push:
69
branches: [main]
10+
paths-ignore:
11+
- "docs/**"
12+
- "**/*.md"
713
workflow_dispatch:
814

915
permissions:
1016
contents: read
1117

18+
concurrency:
19+
group: sdk-java-conformance-${{ github.ref }}
20+
cancel-in-progress: true
21+
1222
jobs:
1323
generate-and-build:
1424
runs-on: blacksmith-2vcpu-ubuntu-2404
1525
timeout-minutes: 12
1626
steps:
17-
- uses: actions/checkout@v5
27+
- uses: actions/checkout@v7
1828
- uses: actions/setup-java@v5
1929
with:
2030
distribution: temurin
2131
java-version: '17'
32+
- name: Restore OpenAPI generator cache
33+
uses: actions/cache@v4
34+
with:
35+
path: /tmp/openapi-generator-cli.jar
36+
key: openapi-generator-cli-7.12.0
37+
- name: Restore generated SDK Maven cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.m2/repository
41+
key: generated-sdk-m2-${{ runner.os }}-7.12.0
42+
restore-keys: |
43+
generated-sdk-m2-${{ runner.os }}-
2244
- name: Fetch immutable contract
2345
run: |
2446
curl --fail --location \
2547
https://raw.githubusercontent.com/CoreLinkPlatform/api-contracts/5bdc07b80c8acbd0617b75e2d7ae3edd17f6324b/openapi/corelink-public-v1.yaml \
2648
--output /tmp/corelink-public-v1.yaml
27-
- name: Fetch pinned generator
49+
- name: Fetch pinned generator when uncached
2850
run: |
29-
curl --fail --location \
30-
https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar \
31-
--output /tmp/openapi-generator-cli.jar
51+
if [ ! -s /tmp/openapi-generator-cli.jar ]; then
52+
curl --fail --location \
53+
https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar \
54+
--output /tmp/openapi-generator-cli.jar
55+
fi
3256
- name: Generate Java client
3357
run: |
3458
rm -rf /tmp/corelink-java-sdk

0 commit comments

Comments
 (0)