Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[experiment] Mimir #2144

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
26 changes: 26 additions & 0 deletions .github/ci-extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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>
83 changes: 47 additions & 36 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,28 @@ jobs:
with:
persist-credentials: false

- name: Cache Maven packages
- 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: ~/.m2/repository/cached
key: maven-${{ runner.os }}-initial-${{ hashFiles('**/pom.xml') }}
path: ~/.mimir/local
key: mimir-${{ runner.os }}-initial-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ runner.os }}-initial-
maven-${{ runner.os }}-
mimir-${{ runner.os }}-initial-
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-2"

- name: Build Maven distributions
shell: bash
run: ./mvnw verify -e -B -V -Dmaven.repo.local=$HOME/.m2/repository/cached
run: ./mvnw verify -e -B -V

- name: List contents of target directory
shell: bash
Expand Down Expand Up @@ -102,6 +108,21 @@ jobs:
with:
persist-credentials: false

- 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 }}-full-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mimir-${{ runner.os }}-full-
mimir-${{ runner.os }}-

- name: Download Maven distribution
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -129,26 +150,17 @@ jobs:
echo "MAVEN_HOME=$PWD/maven-local" >> $GITHUB_ENV
echo "$PWD/maven-local/bin" >> $GITHUB_PATH

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository/cached
key: maven-${{ runner.os }}-full-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ runner.os }}-full-
maven-${{ runner.os }}-

- name: Show IP
shell: bash
run: curl --silent https://api.ipify.org

- name: Build with downloaded Maven
shell: bash
run: mvn verify -Papache-release -Dgpg.skip=true -e -B -V -Dmaven.repo.local=$HOME/.m2/repository/cached
run: mvn verify -Papache-release -Dgpg.skip=true -e -B -V

- name: Build site with downloaded Maven
shell: bash
run: mvn site -e -B -V -Preporting -Dmaven.repo.local=$HOME/.m2/repository/cached
run: mvn site -e -B -V -Preporting

- name: Upload test artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -177,6 +189,21 @@ jobs:
with:
persist-credentials: false

- 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 }}-its-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mimir-${{ runner.os }}-its-
mimir-${{ runner.os }}-

- name: Download Maven distribution
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -204,33 +231,17 @@ jobs:
echo "MAVEN_HOME=$PWD/maven-local" >> $GITHUB_ENV
echo "$PWD/maven-local/bin" >> $GITHUB_PATH

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository/cached
key: maven-${{ runner.os }}-its-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ runner.os }}-its
maven-${{ runner.os }}-

- name: Show IP
shell: bash
run: curl --silent https://api.ipify.org

# we use two steps so that we can cache artifacts downloaded from Maven Central repository
# without installing any local artifacts to not pollute the cache
- name: Build maven and ITs
shell: bash
run: mvn package -DskipTests -e -B -V -Prun-its -Dmaven.repo.local=$HOME/.m2/repository/cached

# Now run tests and ITs using a separate local repo (using the previous filled repo as tail)
- name: Run integration tests
- name: Build Maven and ITs and run them
shell: bash
run: mvn install -e -B -V -Prun-its -Dmaven.repo.local=$HOME/.m2/repository/local -Dmaven.repo.local.tail=$HOME/.m2/repository/cached
run: mvn install -e -B -V -Prun-its

- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ github.run_number }}-integration-test-artifact-${{ runner.os }}-${{ matrix.java }}
path: ./its/core-it-suite/target/test-classes/
path: ./its/core-it-suite/target/test-classes/