From 45d79883991091eb1113d3600f06694e31f7c752 Mon Sep 17 00:00:00 2001 From: David Gamez <1192523+davidgamez@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:26:18 -0500 Subject: [PATCH] fix: python scripts failing in ubuntu-latest GitHub workflows (#1944) --- .github/workflows/acceptance_test.yml | 37 ++++++++++++------- .github/workflows/docker.yml | 16 +++++--- .github/workflows/end_to_end.yml | 15 ++++++-- .github/workflows/formatting.yml | 10 +++-- .../workflows/notice_migration_generation.yml | 16 +++++--- .github/workflows/package_installers.yml | 8 ++-- .github/workflows/publish_assets.yml | 10 +++-- .github/workflows/stg_web_client_merge.yml | 8 ++-- .github/workflows/stg_web_svc_merge.yml | 8 ++-- .github/workflows/web_client_pr.yml | 8 ++-- .github/workflows/web_release.yml | 8 ++-- .github/workflows/web_svc_pr.yml | 8 ++-- .../requirements.txt | 30 +++++++-------- .../requirements.txt | 16 ++++---- 14 files changed, 123 insertions(+), 75 deletions(-) diff --git a/.github/workflows/acceptance_test.yml b/.github/workflows/acceptance_test.yml index d279b38ecf..19a5ff4c9f 100644 --- a/.github/workflows/acceptance_test.yml +++ b/.github/workflows/acceptance_test.yml @@ -19,17 +19,23 @@ on: concurrency: group: ${{ github.head_ref }} cancel-in-progress: true + +env: + python_version: '3.11' + java_version: '11' + java_distribution: 'temurin' + jobs: fail_if_pull_request_is_draft: # Fails in order to indicate that pull request needs to be marked as ready to review to pass. if: github.event.pull_request.draft == true - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Fail if PR is a draft run: exit 1 pre_ci: name: Prepare CI environment if: github.event.pull_request.draft == false # Skip this job and its dependencies if the PR is draft - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout Project uses: actions/checkout@v4 @@ -53,20 +59,20 @@ jobs: validate-gradle-wrapper: if: "!contains(needs.pre_ci.outputs.commit_message, '[acceptance test skip]')" needs: pre_ci - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: gradle/actions/wrapper-validation@v3 pack-snapshot: needs: [ validate-gradle-wrapper ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v4 with: @@ -89,16 +95,16 @@ jobs: path: output-comparator/build/libs/output-comparator-*-cli.jar pack-master: needs: [ validate-gradle-wrapper ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: master - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v4 with: @@ -117,10 +123,13 @@ jobs: fetch-urls: if: "!contains(needs.pre_ci.outputs.commit_message, '[acceptance test skip]')" needs: pre_ci - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout repository code uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.python_version }} - name: Install dependencies run: | pip install -r scripts/mobility-database-harvester/requirements.txt @@ -174,7 +183,7 @@ jobs: name: reports_${{ env.CONCATENATED_IDS }} path: ${{ github.sha }}/output merge-reports-artifacts: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: [ get-reports ] steps: - name: Merge Artifacts @@ -185,7 +194,7 @@ jobs: delete-merged: true compare-outputs: needs: [ merge-reports-artifacts ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Download comparator .jar file from previous job diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ce80299f00..f9c6efb82d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,6 +6,10 @@ on: release: types: [ prereleased, released ] +env: + java_version: '11' + java_distribution: 'temurin' + jobs: validate_gradle_wrapper: runs-on: ubuntu-latest @@ -17,11 +21,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v3 with: @@ -47,11 +51,11 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # need full clone so `./gradlew currentVersion` can search parents for older tags when needed - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v3 with: diff --git a/.github/workflows/end_to_end.yml b/.github/workflows/end_to_end.yml index fcb5624190..a0cb2366a4 100644 --- a/.github/workflows/end_to_end.yml +++ b/.github/workflows/end_to_end.yml @@ -32,6 +32,12 @@ on: - 'web/**' - '.github/workflows/**' workflow_dispatch: + +env: + python_version: '3.11' + java_version: '11' + java_distribution: 'temurin' + jobs: validate_gradle_wrapper: runs-on: ubuntu-latest @@ -43,11 +49,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v3 with: @@ -68,6 +74,9 @@ jobs: steps: - name: Checkout repository code uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.python_version }} - name: Install dependencies run: | pip install -r scripts/mobility-database-harvester/requirements.txt diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 7a55a6e03a..8e6c9c905a 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -7,16 +7,20 @@ on: - '**.md' - '.github/workflows/**' +env: + java_version: '11' + java_distribution: 'temurin' + jobs: formatting: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '11' - distribution: 'temurin' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Cache Gradle packages uses: actions/cache@v3 with: diff --git a/.github/workflows/notice_migration_generation.yml b/.github/workflows/notice_migration_generation.yml index 7c399e7368..57974faa0f 100644 --- a/.github/workflows/notice_migration_generation.yml +++ b/.github/workflows/notice_migration_generation.yml @@ -7,26 +7,32 @@ on: description: 'The release version to add to NOTICE_MIGRATION.md. e.g. v5.0.2' required: true +env: + python-version: '3.11' + java_version: '17' + java_distribution: 'zulu' + + jobs: update_notice_migration: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Setup Python + - name: Setup Python ${{ env.python_version }} uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: ${{ env.python_version }} cache: 'pip' - name: Install dependencies run: pip install -r scripts/notice-migration-generator/requirements.txt - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '17' - distribution: 'zulu' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Get previous release version # The script will set the PREVIOUS_VERSION environment variable diff --git a/.github/workflows/package_installers.yml b/.github/workflows/package_installers.yml index 9f003eda3a..c163bf7daf 100644 --- a/.github/workflows/package_installers.yml +++ b/.github/workflows/package_installers.yml @@ -27,6 +27,8 @@ env: MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_USERNAME }} MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} MACOS_NOTARIZATION_PWD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }} + java_version: '17.0' + java_distribution: 'zulu' jobs: validate_gradle_wrapper: @@ -54,13 +56,13 @@ jobs: - name: Get short commit hash run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17.0' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # We create a code-signing keychain on MacOS before building and packaging the app, as the # app will be signed as part of the jpackage build phase. diff --git a/.github/workflows/publish_assets.yml b/.github/workflows/publish_assets.yml index 0d6ba3be65..4c76ab93bb 100644 --- a/.github/workflows/publish_assets.yml +++ b/.github/workflows/publish_assets.yml @@ -5,6 +5,10 @@ on: types: [ prereleased, released ] workflow_dispatch: +env: + java_version: '17.0' + java_distribution: 'zulu' + jobs: upload-release-assets: runs-on: ubuntu-latest @@ -21,11 +25,11 @@ jobs: - name: printVersion run: echo "The version extracted from github.ref is ${{ steps.get_version.outputs.version }}" - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v3 with: - java-version: '17' - distribution: 'zulu' + java-version: ${{ env.java_version }} + distribution: ${{ env.java_distribution }} - name: Generate CLI jar if: github.event_name == 'release' diff --git a/.github/workflows/stg_web_client_merge.yml b/.github/workflows/stg_web_client_merge.yml index 8535a213fe..1411404e8a 100644 --- a/.github/workflows/stg_web_client_merge.yml +++ b/.github/workflows/stg_web_client_merge.yml @@ -8,6 +8,8 @@ on: env: NODE_VERSION: "20" + java_version: '17.0' + java_distribution: 'zulu' jobs: @@ -27,13 +29,13 @@ jobs: # can resolve the most recent version tag. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # for npm - uses: actions/setup-node@v4 diff --git a/.github/workflows/stg_web_svc_merge.yml b/.github/workflows/stg_web_svc_merge.yml index 115347612b..42e692e6e4 100644 --- a/.github/workflows/stg_web_svc_merge.yml +++ b/.github/workflows/stg_web_svc_merge.yml @@ -8,6 +8,8 @@ on: env: NODE_VERSION: "20" + java_version: '17.0' + java_distribution: 'zulu' jobs: @@ -27,13 +29,13 @@ jobs: # can resolve the most recent version tag. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # for npm - uses: actions/setup-node@v4 diff --git a/.github/workflows/web_client_pr.yml b/.github/workflows/web_client_pr.yml index ba513a1468..ac87d0156d 100644 --- a/.github/workflows/web_client_pr.yml +++ b/.github/workflows/web_client_pr.yml @@ -10,6 +10,8 @@ on: env: NODE_VERSION: "20" + java_version: '17.0' + java_distribution: 'zulu' jobs: @@ -29,13 +31,13 @@ jobs: # can resolve the most recent version tag. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # for npm - uses: actions/setup-node@v4 diff --git a/.github/workflows/web_release.yml b/.github/workflows/web_release.yml index fe748ccecd..74e5a77522 100644 --- a/.github/workflows/web_release.yml +++ b/.github/workflows/web_release.yml @@ -6,6 +6,8 @@ on: env: NODE_VERSION: "20" + java_version: '17.0' + java_distribution: 'zulu' jobs: @@ -25,13 +27,13 @@ jobs: # can resolve the most recent version tag. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # for npm - uses: actions/setup-node@v4 diff --git a/.github/workflows/web_svc_pr.yml b/.github/workflows/web_svc_pr.yml index 10bc7191e5..996947ac83 100644 --- a/.github/workflows/web_svc_pr.yml +++ b/.github/workflows/web_svc_pr.yml @@ -9,6 +9,8 @@ on: env: NODE_VERSION: "20" + java_version: '17.0' + java_distribution: 'zulu' jobs: @@ -28,13 +30,13 @@ jobs: # can resolve the most recent version tag. fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} uses: actions/setup-java@v4 with: # We need a recent version of Java with jpackage included. - java-version: '17' + java-version: ${{ env.java_version }} # We use the zulu distribution, which is an OpenJDK distro. - distribution: 'zulu' + distribution: ${{ env.java_distribution }} # for npm - uses: actions/setup-node@v4 diff --git a/scripts/mobility-database-harvester/requirements.txt b/scripts/mobility-database-harvester/requirements.txt index 7c098904a6..a082ec3395 100644 --- a/scripts/mobility-database-harvester/requirements.txt +++ b/scripts/mobility-database-harvester/requirements.txt @@ -1,17 +1,17 @@ -cachetools==4.2.2 -certifi==2024.7.4 -charset-normalizer==2.0.4 -idna==3.7 -pandas==1.4.3 -packaging==21.0 -protobuf==3.18.3 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pyparsing==2.4.7 -python-dateutil==2.8.1 -pytz==2021.1 +cachetools==5.5.0 +certifi==2024.12.14 +charset-normalizer==3.4.1 +idna==3.10 +pandas==2.2.3 +packaging==24.2 +protobuf==5.29.3 +pyasn1==0.6.1 +pyasn1-modules==0.4.1 +pyparsing==3.2.1 +python-dateutil==2.8.2 +pytz==2024.2 requests==2.32.3 -rsa==4.7.2 -six==1.16.0 +rsa==4.9 +six==1.17.0 urllib3==1.26.19 -numpy==1.22.0 +numpy==2.2.2 \ No newline at end of file diff --git a/scripts/notice-migration-generator/requirements.txt b/scripts/notice-migration-generator/requirements.txt index 20f2f51786..e04d1ef067 100644 --- a/scripts/notice-migration-generator/requirements.txt +++ b/scripts/notice-migration-generator/requirements.txt @@ -1,11 +1,11 @@ -importlib-metadata==6.8.0 -numpy==1.25.0 -pandas==2.0.3 -python-dateutil==2.8.2 -pytz==2023.3 -tzdata==2023.3 -six==1.16.0 -zipp==3.19.1 +importlib-metadata==8.5.0 +numpy==2.2.2 +pandas==2.2.3 +python-dateutil==2.9.0.post0 +pytz==2024.2 +tzdata==2024.2 +six==1.17.0 +zipp==3.21.0 markdown tabulate jsondiff \ No newline at end of file