fix: repair workflows integrationtests docker #459
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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Integration test suite | |
on: | |
push: | |
branches: [ "main", "feat/**" ] | |
pull_request: | |
branches: [ "main", "feat/**" ] | |
jobs: | |
ors-test-scenarios: | |
name: Build with Maven and Docker caches | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
cache-dependency-path: ./pom.xml | |
- name: Restore cached ors test image | |
id: restore-cached-image | |
uses: actions/cache/restore@v4 | |
with: | |
path: ors-test-scenarios-war-bare.tar | |
key: ${{ runner.os }}-ors-test-scenarios-war-bare- | |
- name: Load the docker image | |
# Load the docker image if the cache hit | |
if: ${{ hashFiles('ors-test-scenarios-war-bare.tar') != '' }} | |
run: | | |
echo "Loading the docker image" | |
docker load -i ors-test-scenarios-war-bare.tar | |
- name: Cache Maven dependencies for the ors maven project | |
run: | | |
echo "Caching the maven dependencies" | |
mvn -pl ors-test-scenarios package -Dmaven.test.skip=true -B dependency:go-offline -q | |
- name: Build the docker image with the one shot builder | |
run: | | |
echo "Building the docker image with the one shot builder" | |
mvn -pl ors-test-scenarios test | |
env: | |
ONE_SHOT_IMAGE_BUILDER: true | |
- name: Export the docker image to be cached | |
run: | | |
echo "Exporting the docker image" | |
docker save -o ors-test-scenarios-war-bare.tar ors-test-scenarios-war-bare:latest | |
- name: Save the docker image to the cache | |
uses: actions/cache/save@v4 | |
with: | |
path: ors-test-scenarios-war-bare.tar | |
key: ${{ runner.os }}-ors-test-scenarios-war-bare-${{ hashFiles('ors-test-scenarios-war-bare.tar') }} | |
# - name: Run integration tests | |
# run: | | |
# echo "List all docker images" | |
# docker image ls -a | |
# echo "Running integration tests" | |
# mvn -pl ors-test-scenarios test |