From 2c9cee0ddaddf70e4c1e61a4e0f86d7b77ea9a1c Mon Sep 17 00:00:00 2001 From: Jesse Jaara Date: Thu, 5 Sep 2024 13:58:06 +0300 Subject: [PATCH] Update Github Workflows * Run on Ubuntu 24.04 or 22.04 for tasks requiring e2e env * Use actions/setup-java build-in cache --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/docker-build.yml | 2 +- .github/workflows/run-cypress-tests.yml | 3 +++ .github/workflows/run-java-tests.yml | 10 ++-------- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fd7ca7f2c..20bdaf129 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: 24.04 env: TZ: Europe/Oslo steps: @@ -31,7 +31,7 @@ jobs: image: # only build and push the image when it's a commit to master in Entur's repository if: github.repository_owner == 'entur' && github.event_name == 'push' - runs-on: ubuntu-latest + runs-on: 24.04 needs: [ tests ] env: CONTAINER_REPO: docker.io/entur/tiamat @@ -50,4 +50,4 @@ jobs: - name: Build container image with Jib, push to container repo run: | image_date=`date +%Y-%m-%dT%H-%M` - mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_date \ No newline at end of file + mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_date diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6f0328e84..e87b73bdc 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -15,7 +15,7 @@ jobs: push_to_registry: needs: run_java_tests name: Build & Push Docker image to Docker Hub - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code diff --git a/.github/workflows/run-cypress-tests.yml b/.github/workflows/run-cypress-tests.yml index 9670a3e20..073d84d8b 100644 --- a/.github/workflows/run-cypress-tests.yml +++ b/.github/workflows/run-cypress-tests.yml @@ -8,6 +8,9 @@ on: jobs: run_cypress_tests: name: Run cypress e2e tests from Docker + # These must run on ubuntu 22.04 or older. + # The MS SQL server used by jore4-jore3-importer, + # does not run on Linux kernels newer than 6.6.x. runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/run-java-tests.yml b/.github/workflows/run-java-tests.yml index 23d40df9d..c53a13593 100644 --- a/.github/workflows/run-java-tests.yml +++ b/.github/workflows/run-java-tests.yml @@ -10,7 +10,7 @@ env: jobs: run-tests: name: Run java tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -26,13 +26,7 @@ jobs: java-package: jdk architecture: x64 distribution: temurin - - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + cache: maven - name: Run tests and try building a package run: |