Skip to content

Commit

Permalink
fix(integration-tests): Maven cache repair
Browse files Browse the repository at this point in the history
Currently, the matrix workflow is still downloading the dependencies.
  • Loading branch information
MichaelsJP committed Nov 17, 2024
1 parent bc9f5d9 commit af54af0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 13 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache Maven dependencies for the ors maven project
run: |
echo "Sync the maven dependencies"
mvn dependency:go-offline -B -q
mvn -pl ors-engine,ors-api,ors-test-scenarios package -Dmaven.test.skip=true -B dependency:go-offline dependency:resolve-plugins dependency:resolve
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: inject maven-build-cache into docker
Expand Down Expand Up @@ -96,7 +101,7 @@ jobs:
key: ${{ runner.os }}-ors-test-scenarios-builder-images-${{ steps.docker_build.outputs.imageid }}
- name: Build shared graph
run: |
mvn -pl ors-test-scenarios -Dtest=utils.OneShotGraphBuilderTest\#oneShotGraphBuilder test \
mvn -pl ors-test-scenarios -q -Dtest=utils.OneShotGraphBuilderTest\#oneShotGraphBuilder test \
-Dcontainer.builder.use_prebuild=true
env:
ONE_SHOT_GRAPH_BUILDER: true
Expand Down Expand Up @@ -125,8 +130,19 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Prepare the setup
run: |
echo "Sync the maven dependencies and build the project"
mvn -pl ors-test-scenarios,ors-api,ors-engine package -Dmaven.test.skip=true -B dependency:go-offline dependency:resolve-plugins dependency:resolve
# Prepare the Dockerfile for efficient caching with buildx
sed -i 's/RUN mvn dependency:go-offline -B -q/RUN --mount=type=cache,target=\/root\/.m2 mvn dependency:go-offline -B -q/' ors-test-scenarios/src/test/resources/Builder.Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: inject maven-build-cache into docker
Expand All @@ -143,12 +159,6 @@ jobs:
path: |
ors-test-scenarios/graphs-integrationtests
key: ${{ runner.os }}-ors-test-scenarios-builder-images-${{ needs.build-default-builder.outputs.builder_image_id }}
- name: Prepare the setup
run: |
echo "Sync the maven dependencies and build the project"
mvn dependency:go-offline -B -q
# Prepare the Dockerfile for efficient caching with buildx
sed -i 's/RUN mvn dependency:go-offline -B -q/RUN --mount=type=cache,target=\/root\/.m2 mvn dependency:go-offline -B -q/' ors-test-scenarios/src/test/resources/Builder.Dockerfile
- name: Build ors-test-scenarios-builder
id: docker_build
uses: docker/build-push-action@v6
Expand Down
5 changes: 5 additions & 0 deletions ors-test-scenarios/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down
21 changes: 20 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<jsr311-api-version>1.1.1</jsr311-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotless.version>2.27.2</spotless.version>
<surefire.version>3.1.2</surefire.version>

<sonar.projectKey>GIScience_openrouteservice</sonar.projectKey>
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
Expand All @@ -122,6 +123,18 @@
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<profiles>
Expand All @@ -144,6 +157,12 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>${surefire.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.GIScience.graphhopper</groupId>
<artifactId>graphhopper-core</artifactId>
Expand Down Expand Up @@ -614,7 +633,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>${surefire.version}</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
Expand Down

0 comments on commit af54af0

Please sign in to comment.