[CI] Use Mimir on CI (#1283)

Use Maveniverse Mimir to cache central artifacts. This makes caching way simpler as well. Update Maven used to build to Maven 4.0.0-rc-3 as well.
This commit is contained in:
Tamas Cservenak
2025-03-13 13:55:29 +01:00
committed by GitHub
parent 6c5dd056fa
commit 0c00328d06
2 changed files with 62 additions and 0 deletions

24
.github/ci-extensions.xml vendored Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<extensions>
<extension>
<groupId>eu.maveniverse.maven.mimir</groupId>
<artifactId>extension</artifactId>
<version>0.4.0</version>
</extension>
</extensions>

View File

@@ -46,6 +46,25 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: 'Prepare Mimir'
shell: bash
run: |
mkdir -p ~/.m2
cp .github/ci-extensions.xml ~/.m2/extensions.xml
- name: 'Handle Mimir caches'
uses: actions/cache@v4
with:
path: ~/.mimir/local
key: mimir-${{ runner.os }}-default-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mimir-${{ runner.os }}-default-
mimir-${{ runner.os }}-
- name: 'Set up Maven'
shell: bash
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=4.0.0-rc-3"
- name: 'Run default (non-native) build'
run: ./mvnw verify -Dmrm=false -V -B -ntp -e -s .mvn/release-settings.xml
@@ -100,6 +119,25 @@ jobs:
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Prepare Mimir'
shell: bash
run: |
mkdir -p ~/.m2
cp .github/ci-extensions.xml ~/.m2/extensions.xml
- name: 'Handle Mimir caches'
uses: actions/cache@v4
with:
path: ~/.mimir/local
key: mimir-${{ runner.os }}-native-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mimir-${{ runner.os }}-native-
mimir-${{ runner.os }}-
- name: 'Set up Maven'
shell: bash
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=4.0.0-rc-3"
- name: 'Maven clean'
run: ./mvnw clean -Dmrm=false -V -B -ntp -e