Skip to content

Commit 45d7988

Browse files
authored
fix: python scripts failing in ubuntu-latest GitHub workflows (#1944)
1 parent ee798a1 commit 45d7988

File tree

14 files changed

+123
-75
lines changed

14 files changed

+123
-75
lines changed

.github/workflows/acceptance_test.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@ on:
1919
concurrency:
2020
group: ${{ github.head_ref }}
2121
cancel-in-progress: true
22+
23+
env:
24+
python_version: '3.11'
25+
java_version: '11'
26+
java_distribution: 'temurin'
27+
2228
jobs:
2329
fail_if_pull_request_is_draft: # Fails in order to indicate that pull request needs to be marked as ready to review to pass.
2430
if: github.event.pull_request.draft == true
25-
runs-on: ubuntu-22.04
31+
runs-on: ubuntu-latest
2632
steps:
2733
- name: Fail if PR is a draft
2834
run: exit 1
2935
pre_ci:
3036
name: Prepare CI environment
3137
if: github.event.pull_request.draft == false # Skip this job and its dependencies if the PR is draft
32-
runs-on: ubuntu-22.04
38+
runs-on: ubuntu-latest
3339
steps:
3440
- name: Checkout Project
3541
uses: actions/checkout@v4
@@ -53,20 +59,20 @@ jobs:
5359
validate-gradle-wrapper:
5460
if: "!contains(needs.pre_ci.outputs.commit_message, '[acceptance test skip]')"
5561
needs: pre_ci
56-
runs-on: ubuntu-22.04
62+
runs-on: ubuntu-latest
5763
steps:
5864
- uses: actions/checkout@v4
5965
- uses: gradle/actions/wrapper-validation@v3
6066
pack-snapshot:
6167
needs: [ validate-gradle-wrapper ]
62-
runs-on: ubuntu-22.04
68+
runs-on: ubuntu-latest
6369
steps:
6470
- uses: actions/checkout@v4
65-
- name: Set up JDK 11
71+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
6672
uses: actions/setup-java@v4
6773
with:
68-
java-version: '11'
69-
distribution: 'temurin'
74+
java-version: ${{ env.java_version }}
75+
distribution: ${{ env.java_distribution }}
7076
- name: Cache Gradle packages
7177
uses: actions/cache@v4
7278
with:
@@ -89,16 +95,16 @@ jobs:
8995
path: output-comparator/build/libs/output-comparator-*-cli.jar
9096
pack-master:
9197
needs: [ validate-gradle-wrapper ]
92-
runs-on: ubuntu-22.04
98+
runs-on: ubuntu-latest
9399
steps:
94100
- uses: actions/checkout@v4
95101
with:
96102
ref: master
97-
- name: Set up JDK 11
103+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
98104
uses: actions/setup-java@v4
99105
with:
100-
java-version: '11'
101-
distribution: 'temurin'
106+
java-version: ${{ env.java_version }}
107+
distribution: ${{ env.java_distribution }}
102108
- name: Cache Gradle packages
103109
uses: actions/cache@v4
104110
with:
@@ -117,10 +123,13 @@ jobs:
117123
fetch-urls:
118124
if: "!contains(needs.pre_ci.outputs.commit_message, '[acceptance test skip]')"
119125
needs: pre_ci
120-
runs-on: ubuntu-22.04
126+
runs-on: ubuntu-latest
121127
steps:
122128
- name: Checkout repository code
123129
uses: actions/checkout@v4
130+
- uses: actions/setup-python@v5
131+
with:
132+
python-version: ${{ env.python_version }}
124133
- name: Install dependencies
125134
run: |
126135
pip install -r scripts/mobility-database-harvester/requirements.txt
@@ -174,7 +183,7 @@ jobs:
174183
name: reports_${{ env.CONCATENATED_IDS }}
175184
path: ${{ github.sha }}/output
176185
merge-reports-artifacts:
177-
runs-on: ubuntu-22.04
186+
runs-on: ubuntu-latest
178187
needs: [ get-reports ]
179188
steps:
180189
- name: Merge Artifacts
@@ -185,7 +194,7 @@ jobs:
185194
delete-merged: true
186195
compare-outputs:
187196
needs: [ merge-reports-artifacts ]
188-
runs-on: ubuntu-22.04
197+
runs-on: ubuntu-latest
189198
steps:
190199
- uses: actions/checkout@v4
191200
- name: Download comparator .jar file from previous job

.github/workflows/docker.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
release:
77
types: [ prereleased, released ]
88

9+
env:
10+
java_version: '11'
11+
java_distribution: 'temurin'
12+
913
jobs:
1014
validate_gradle_wrapper:
1115
runs-on: ubuntu-latest
@@ -17,11 +21,11 @@ jobs:
1721
runs-on: ubuntu-latest
1822
steps:
1923
- uses: actions/checkout@v3
20-
- name: Set up JDK 11
24+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
2125
uses: actions/setup-java@v3
2226
with:
23-
java-version: '11'
24-
distribution: 'temurin'
27+
java-version: ${{ env.java_version }}
28+
distribution: ${{ env.java_distribution }}
2529
- name: Cache Gradle packages
2630
uses: actions/cache@v3
2731
with:
@@ -47,11 +51,11 @@ jobs:
4751
- uses: actions/checkout@v3
4852
with:
4953
fetch-depth: 0 # need full clone so `./gradlew currentVersion` can search parents for older tags when needed
50-
- name: Set up JDK 11
54+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
5155
uses: actions/setup-java@v3
5256
with:
53-
java-version: '11'
54-
distribution: 'temurin'
57+
java-version: ${{ env.java_version }}
58+
distribution: ${{ env.java_distribution }}
5559
- name: Cache Gradle packages
5660
uses: actions/cache@v3
5761
with:

.github/workflows/end_to_end.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ on:
3232
- 'web/**'
3333
- '.github/workflows/**'
3434
workflow_dispatch:
35+
36+
env:
37+
python_version: '3.11'
38+
java_version: '11'
39+
java_distribution: 'temurin'
40+
3541
jobs:
3642
validate_gradle_wrapper:
3743
runs-on: ubuntu-latest
@@ -43,11 +49,11 @@ jobs:
4349
runs-on: ubuntu-latest
4450
steps:
4551
- uses: actions/checkout@v3
46-
- name: Set up JDK 11
52+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
4753
uses: actions/setup-java@v3
4854
with:
49-
java-version: '11'
50-
distribution: 'temurin'
55+
java-version: ${{ env.java_version }}
56+
distribution: ${{ env.java_distribution }}
5157
- name: Cache Gradle packages
5258
uses: actions/cache@v3
5359
with:
@@ -68,6 +74,9 @@ jobs:
6874
steps:
6975
- name: Checkout repository code
7076
uses: actions/checkout@v3
77+
- uses: actions/setup-python@v5
78+
with:
79+
python-version: ${{ env.python_version }}
7180
- name: Install dependencies
7281
run: |
7382
pip install -r scripts/mobility-database-harvester/requirements.txt

.github/workflows/formatting.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ on:
77
- '**.md'
88
- '.github/workflows/**'
99

10+
env:
11+
java_version: '11'
12+
java_distribution: 'temurin'
13+
1014
jobs:
1115
formatting:
1216
runs-on: ubuntu-latest
1317
steps:
1418
- uses: actions/checkout@v3
15-
- name: Set up JDK 11
19+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
1620
uses: actions/setup-java@v3
1721
with:
18-
java-version: '11'
19-
distribution: 'temurin'
22+
java-version: ${{ env.java_version }}
23+
distribution: ${{ env.java_distribution }}
2024
- name: Cache Gradle packages
2125
uses: actions/cache@v3
2226
with:

.github/workflows/notice_migration_generation.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,32 @@ on:
77
description: 'The release version to add to NOTICE_MIGRATION.md. e.g. v5.0.2'
88
required: true
99

10+
env:
11+
python-version: '3.11'
12+
java_version: '17'
13+
java_distribution: 'zulu'
14+
15+
1016
jobs:
1117
update_notice_migration:
1218
runs-on: ubuntu-latest
1319
steps:
1420
- uses: actions/checkout@v3
1521

16-
- name: Setup Python
22+
- name: Setup Python ${{ env.python_version }}
1723
uses: actions/setup-python@v4
1824
with:
19-
python-version: '3.11'
25+
python-version: ${{ env.python_version }}
2026
cache: 'pip'
2127

2228
- name: Install dependencies
2329
run: pip install -r scripts/notice-migration-generator/requirements.txt
2430

25-
- name: Set up JDK 17
31+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
2632
uses: actions/setup-java@v3
2733
with:
28-
java-version: '17'
29-
distribution: 'zulu'
34+
java-version: ${{ env.java_version }}
35+
distribution: ${{ env.java_distribution }}
3036

3137
- name: Get previous release version
3238
# The script will set the PREVIOUS_VERSION environment variable

.github/workflows/package_installers.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ env:
2727
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
2828
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
2929
MACOS_NOTARIZATION_PWD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
30+
java_version: '17.0'
31+
java_distribution: 'zulu'
3032

3133
jobs:
3234
validate_gradle_wrapper:
@@ -54,13 +56,13 @@ jobs:
5456
- name: Get short commit hash
5557
run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
5658

57-
- name: Set up JDK 17
59+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
5860
uses: actions/setup-java@v4
5961
with:
6062
# We need a recent version of Java with jpackage included.
61-
java-version: '17.0'
63+
java-version: ${{ env.java_version }}
6264
# We use the zulu distribution, which is an OpenJDK distro.
63-
distribution: 'zulu'
65+
distribution: ${{ env.java_distribution }}
6466

6567
# We create a code-signing keychain on MacOS before building and packaging the app, as the
6668
# app will be signed as part of the jpackage build phase.

.github/workflows/publish_assets.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types: [ prereleased, released ]
66
workflow_dispatch:
77

8+
env:
9+
java_version: '17.0'
10+
java_distribution: 'zulu'
11+
812
jobs:
913
upload-release-assets:
1014
runs-on: ubuntu-latest
@@ -21,11 +25,11 @@ jobs:
2125
- name: printVersion
2226
run: echo "The version extracted from github.ref is ${{ steps.get_version.outputs.version }}"
2327

24-
- name: Set up JDK 17
28+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
2529
uses: actions/setup-java@v3
2630
with:
27-
java-version: '17'
28-
distribution: 'zulu'
31+
java-version: ${{ env.java_version }}
32+
distribution: ${{ env.java_distribution }}
2933

3034
- name: Generate CLI jar
3135
if: github.event_name == 'release'

.github/workflows/stg_web_client_merge.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
env:
1010
NODE_VERSION: "20"
11+
java_version: '17.0'
12+
java_distribution: 'zulu'
1113

1214
jobs:
1315

@@ -27,13 +29,13 @@ jobs:
2729
# can resolve the most recent version tag.
2830
fetch-depth: 0
2931

30-
- name: Set up JDK 17
32+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
3133
uses: actions/setup-java@v4
3234
with:
3335
# We need a recent version of Java with jpackage included.
34-
java-version: '17'
36+
java-version: ${{ env.java_version }}
3537
# We use the zulu distribution, which is an OpenJDK distro.
36-
distribution: 'zulu'
38+
distribution: ${{ env.java_distribution }}
3739

3840
# for npm
3941
- uses: actions/setup-node@v4

.github/workflows/stg_web_svc_merge.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
env:
1010
NODE_VERSION: "20"
11+
java_version: '17.0'
12+
java_distribution: 'zulu'
1113

1214
jobs:
1315

@@ -27,13 +29,13 @@ jobs:
2729
# can resolve the most recent version tag.
2830
fetch-depth: 0
2931

30-
- name: Set up JDK 17
32+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
3133
uses: actions/setup-java@v4
3234
with:
3335
# We need a recent version of Java with jpackage included.
34-
java-version: '17'
36+
java-version: ${{ env.java_version }}
3537
# We use the zulu distribution, which is an OpenJDK distro.
36-
distribution: 'zulu'
38+
distribution: ${{ env.java_distribution }}
3739

3840
# for npm
3941
- uses: actions/setup-node@v4

.github/workflows/web_client_pr.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010

1111
env:
1212
NODE_VERSION: "20"
13+
java_version: '17.0'
14+
java_distribution: 'zulu'
1315

1416
jobs:
1517

@@ -29,13 +31,13 @@ jobs:
2931
# can resolve the most recent version tag.
3032
fetch-depth: 0
3133

32-
- name: Set up JDK 17
34+
- name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }}
3335
uses: actions/setup-java@v4
3436
with:
3537
# We need a recent version of Java with jpackage included.
36-
java-version: '17'
38+
java-version: ${{ env.java_version }}
3739
# We use the zulu distribution, which is an OpenJDK distro.
38-
distribution: 'zulu'
40+
distribution: ${{ env.java_distribution }}
3941

4042
# for npm
4143
- uses: actions/setup-node@v4

0 commit comments

Comments
 (0)