Skip to content

Commit ebf07e7

Browse files
committed
Extract unicode dump into separate workflow to reduce amount of downloads
1 parent 1a05e0d commit ebf07e7

File tree

8 files changed

+54
-20
lines changed

8 files changed

+54
-20
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ concurrency:
4545
group: bench-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.after }}
4646

4747
jobs:
48+
dump-unicode-data:
49+
uses: ./.github/workflows/unicode-dump.yml
4850
benchmark-matrix:
51+
needs:
52+
- dump-unicode-data
4953
strategy:
5054
matrix:
5155
include:
@@ -86,6 +90,7 @@ jobs:
8690
- name: Cache unicode data
8791
uses: actions/cache@v4
8892
with:
93+
fail-on-cache-miss: true
8994
path: unicode_dump
9095
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
9196
restore-keys: |

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- name: Cache unicode data
4040
uses: actions/cache@v4
4141
with:
42+
fail-on-cache-miss: true
4243
path: unicode_dump
4344
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
4445
restore-keys: |

.github/workflows/check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
- name: Cache unicode data
5757
uses: actions/cache@v4
5858
with:
59+
fail-on-cache-miss: true
5960
path: unicode_dump
6061
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
6162
restore-keys: |

.github/workflows/code-coverage-upload.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
name: coverage-reports
2222
path: reports/
2323
run_id: ${{ github.event.workflow_run.id }}
24-
- name: Download PR number
25-
uses: dawidd6/action-download-artifact@v6
26-
with:
27-
name: pr-number
28-
path: '.'
29-
run_id: ${{ github.event.workflow_run.id }}
3024
- name: Upload coverage reports to Codecov
3125
uses: codecov/codecov-action@v4
3226
with:

.github/workflows/pull_request.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14+
dump-unicode-data:
15+
uses: ./.github/workflows/unicode-dump.yml
1416
reviewdog:
17+
needs:
18+
- dump-unicode-data
1519
permissions:
1620
pull-requests: write
1721
runs-on: ubuntu-latest
@@ -34,6 +38,7 @@ jobs:
3438
- name: Cache unicode data
3539
uses: actions/cache@v4
3640
with:
41+
fail-on-cache-miss: true
3742
path: unicode_dump
3843
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
3944
restore-keys: |
@@ -51,6 +56,8 @@ jobs:
5156
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5257
run: reviewdog -tee -reporter=github-pr-review
5358
check-pr:
59+
needs:
60+
- dump-unicode-data
5461
uses: ./.github/workflows/build-and-test.yml
5562
with:
5663
collect-code-coverage: true
@@ -69,17 +76,3 @@ jobs:
6976
dangerfile: Dangerfile.df.kts
7077
env:
7178
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
store-pr-number:
73-
runs-on: ubuntu-latest
74-
steps:
75-
- name: Save PR number
76-
env:
77-
PR_NUMBER: ${{ github.event.number }}
78-
run: |
79-
mkdir -p ./pr
80-
echo $PR_NUMBER > ./pr/pr_number
81-
- uses: actions/upload-artifact@v4
82-
with:
83-
name: pr-number
84-
path: pr/
85-

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ jobs:
2424
version-source: file
2525
version-file: ${{ env.VERSION_FILE }}
2626
version-file-extraction-pattern: ${{ env.VERSION_PATTERN }}
27+
dump-unicode-data:
28+
uses: ./.github/workflows/unicode-dump.yml
2729
build-and-test:
30+
needs:
31+
- dump-unicode-data
2832
uses: ./.github/workflows/build-and-test.yml
2933
publish_artifacts:
3034
needs:
@@ -55,6 +59,7 @@ jobs:
5559
- name: Cache unicode data
5660
uses: actions/cache@v4
5761
with:
62+
fail-on-cache-miss: true
5863
path: unicode_dump
5964
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
6065
restore-keys: |

.github/workflows/snapshot_release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ on:
1313
- '.github/workflows/snapshot_release.yml'
1414

1515
jobs:
16+
dump-unicode-data:
17+
uses: ./.github/workflows/unicode-dump.yml
1618
build-and-test:
19+
needs:
20+
- dump-unicode-data
1721
uses: ./.github/workflows/build-and-test.yml
1822
with:
1923
upload-code-coverage: true
@@ -47,6 +51,7 @@ jobs:
4751
- name: Cache unicode data
4852
uses: actions/cache@v4
4953
with:
54+
fail-on-cache-miss: true
5055
path: unicode_dump
5156
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
5257
restore-keys: |

.github/workflows/unicode-dump.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Dump information for Unicode characters
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
generate-dump:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: 'Checkout Repository'
11+
uses: actions/checkout@v4
12+
- uses: actions/setup-java@v4
13+
with:
14+
distribution: temurin
15+
java-version-file: .java-version
16+
- name: Validate Gradle Wrapper
17+
uses: gradle/actions/wrapper-validation@v3
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
with:
21+
gradle-version: wrapper
22+
- name: Cache unicode data
23+
uses: actions/cache@v4
24+
with:
25+
path: unicode_dump
26+
key: unicode-dump-${{ hashFiles('unicode_dump/*') }}
27+
restore-keys: |
28+
unicode-dump-
29+
- name: Build
30+
run: ./gradlew :json-schema-validator:dumpCharacterData

0 commit comments

Comments
 (0)