Update all dependencies #428
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Java tests, push image to Docker hub and run e2e tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run_spotless_check: | |
name: Check code is formatted with Spotless | |
uses: ./.github/workflows/spotless.yml | |
run_java_tests: | |
needs: run_spotless_check | |
name: Run Java tests | |
uses: ./.github/workflows/java-tests.yml | |
push_to_registry: | |
needs: run_java_tests | |
name: Build & Push Docker image to Docker Hub | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract metadata to env variables | |
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 | |
- name: Pull previous images to support caching | |
run: | | |
docker pull $IMAGE_NAME:latest || echo "Previous image not found" | |
docker pull $IMAGE_NAME:builder || echo "Previous image not found" | |
- name: Build dependencies & source code into builder image | |
run: | | |
docker build \ | |
--cache-from=$IMAGE_NAME:builder \ | |
--target builder \ | |
-t $IMAGE_NAME:builder \ | |
. | |
- name: Build clean docker image for distribution | |
run: | | |
docker build \ | |
--cache-from=$IMAGE_NAME:builder \ | |
--cache-from=$IMAGE_NAME:latest \ | |
-t $IMAGE_NAME:latest \ | |
-t $IMAGE_NAME:$COMMIT_ID \ | |
. | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.JORE4_DOCKERHUB_USER }} | |
password: ${{ secrets.JORE4_DOCKERHUB_TOKEN }} | |
- name: Push image tagged with git commit details to Docker Hub | |
run: | | |
docker push $IMAGE_NAME:$COMMIT_ID | |
- name: Push rest of the tags to Docker Hub | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
docker push $IMAGE_NAME:builder | |
docker push $IMAGE_NAME:latest | |
run_e2e_tests: | |
needs: | |
- run_spotless_check | |
- run_java_tests | |
- push_to_registry | |
name: Run E2E tests | |
# These must run on ubuntu 20.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-24.04 | |
steps: | |
- name: Extract metadata to env variables | |
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 | |
- name: Run e2e tests | |
uses: HSLdevcom/jore4-tools/github-actions/run-ci@main | |
with: | |
jore3importer_version: "${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}" | |
start_jore3_importer: "true" |