Podman Test Build (Linux) #537
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: Podman Test Build (Linux) | |
on: | |
workflow_dispatch: | |
schedule: ## Do a run daily, to check our compatibility | |
- cron: '0 1 * * *' | |
env: | |
# Workaround testsuite locale issue | |
LANG: en_US.UTF-8 | |
COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end" | |
NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs" | |
JVM_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dformat.skip -DskipDocs -Dquarkus.test.hang-detection-timeout=60" | |
DB_USER: hibernate_orm_test | |
DB_PASSWORD: hibernate_orm_test | |
DB_NAME: hibernate_orm_test | |
IS_PODMAN: "true" | |
jobs: | |
build-all-the-things: | |
name: "JDK 17 Build" | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_OPTS: "-Xmx2g -XX:MaxMetaspaceSize=1g" | |
# Skip main in forks | |
# Skip draft PRs and those with WIP in the subject, rerun as soon as its removed | |
if: "(github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main')) && ( \ | |
github.event_name != 'pull_request' || ( \ | |
github.event.pull_request.draft == false && \ | |
github.event.pull_request.state != 'closed' && \ | |
contains(github.event.pull_request.title, 'wip ') == false && \ | |
contains(github.event.pull_request.title, '[wip]') == false && \ | |
( | |
github.event.action != 'edited' || \ | |
contains(github.event.changes.title.from, 'wip ') || \ | |
contains(github.event.changes.title.from, '[wip]') \ | |
) \ | |
) \ | |
)" | |
outputs: | |
gib_args: ${{ steps.get-gib-args.outputs.gib_args }} | |
gib_impacted: ${{ steps.get-gib-impacted.outputs.impacted_modules }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add quarkusio remote | |
shell: bash | |
run: git remote show quarkusio &> /dev/null || git remote add quarkusio https://github.com/quarkusio/quarkus.git | |
- name: Reclaim Disk Space | |
if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" | |
run: .github/ci-prerequisites.sh | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Setup docker host | |
run: echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV" | |
- name: Update podman | |
run: | | |
sudo apt-get -y purge podman | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] \ | |
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ | |
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update -qq | |
sudo apt-get -qq -y install podman | |
sudo bash -c "echo -e '[engine]\nservice_timeout=0' >> /etc/containers/containers.conf" | |
# Runs a single command using the runners shell | |
- name: Check podman | |
run: docker version | |
- name: Set up testcontainers for podman | |
run: | | |
echo ryuk.container.privileged=true > ~/.testcontainers.properties | |
- name: Generate cache key | |
id: cache-key | |
run: | | |
CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" | |
CURRENT_MONTH=$(/bin/date -u "+%Y-%m") | |
CURRENT_DAY=$(/bin/date -u "+%d") | |
ROOT_CACHE_KEY="m2-cache" | |
echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT | |
echo "m2-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT | |
echo "m2-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT | |
- name: Restore Maven Repository | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ steps.cache-key.outputs.m2-cache-key }} | |
restore-keys: | | |
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}- | |
${{ steps.cache-key.outputs.m2-monthly-cache-key }}- | |
- name: Initial build | |
run: | | |
./mvnw -T1C $COMMON_MAVEN_ARGS -DskipTests -DskipITs -DskipDocs -Dinvoker.skip -Dskip.gradle.tests -Djbang.skip -Dtruststore.skip -Dno-format -Dtcks -Prelocations clean install | |
- name: Verify extension dependencies | |
shell: bash | |
run: ./update-extension-dependencies.sh $COMMON_MAVEN_ARGS | |
- name: Get GIB arguments | |
id: get-gib-args | |
env: | |
PULL_REQUEST_BASE: ${{ github.event.pull_request.base.ref }} | |
run: | | |
# See also: https://github.com/gitflow-incremental-builder/gitflow-incremental-builder#configuration (GIB) | |
# Common GIB_ARGS for all CI cases (hint: see also root pom.xml): | |
# - disableSelectedProjectsHandling: required to detect changes in jobs that use -pl | |
# - untracked: to ignore files created by jobs (and uncommitted to be consistent) | |
GIB_ARGS="-Dincremental -Dgib.disableSelectedProjectsHandling -Dgib.untracked=false -Dgib.uncommitted=false" | |
if [ -n "$PULL_REQUEST_BASE" ] | |
then | |
# The PR defines a clear merge target so just use that branch for reference, *unless*: | |
# - the current branch is a backport branch targeting some released branch like 1.10 (merge target is not main) | |
GIB_ARGS+=" -Dgib.referenceBranch=origin/$PULL_REQUEST_BASE -Dgib.disableIfReferenceBranchMatches='origin/\d+\.\d+'" | |
else | |
# No PR means the merge target is uncertain so fetch & use main of quarkusio/quarkus, *unless*: | |
# - the current branch is main or some released branch like 1.10 | |
# - the current branch is a backport branch which is going to target some released branch like 1.10 (merge target is not main) | |
GIB_ARGS+=" -Dgib.referenceBranch=refs/remotes/quarkusio/main -Dgib.fetchReferenceBranch -Dgib.disableIfBranchMatches='main|\d+\.\d+|.*backport.*'" | |
fi | |
echo "GIB_ARGS: $GIB_ARGS" | |
echo "gib_args=${GIB_ARGS}" >> $GITHUB_OUTPUT | |
- name: Get GIB impacted modules | |
id: get-gib-impacted | |
# mvnw just for creating gib-impacted.log ("validate" should not waste much time if not incremental at all, e.g. on main) | |
run: | | |
./mvnw -q -T1C $COMMON_MAVEN_ARGS -Dtcks -Dquickly-ci ${{ steps.get-gib-args.outputs.gib_args }} -Dgib.logImpactedTo=gib-impacted.log validate | |
if [ -s gib-impacted.log ] | |
then | |
GIB_IMPACTED=$(cat gib-impacted.log) | |
else | |
GIB_IMPACTED='' | |
fi | |
echo "GIB_IMPACTED: ${GIB_IMPACTED}" | |
# three steps to retain linefeeds in output for other jobs | |
# (see https://github.com/github/docs/issues/21529 and https://github.com/orgs/community/discussions/26288#discussioncomment-3876281) | |
echo 'impacted_modules<<EOF' >> $GITHUB_OUTPUT | |
echo "${GIB_IMPACTED}" >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Stop mysql | |
if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" | |
shell: bash | |
run: | | |
ss -ln | |
sudo service mysql stop || true | |
- name: Support longpaths on Windows | |
if: "startsWith(matrix.java.os-name, 'windows')" | |
run: git config --global core.longpaths true | |
- name: apt clean | |
if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" | |
shell: bash | |
run: sudo apt-get clean | |
- name: Build | |
shell: bash | |
# Despite the pre-calculated run_jvm flag, GIB has to be re-run here to figure out the exact submodules to build. | |
run: ./mvnw $COMMON_MAVEN_ARGS install -Dsurefire.timeout=1200 -pl !integration-tests/gradle -pl !integration-tests/maven -pl !integration-tests/devmode -pl !integration-tests/devtools -Dno-test-kubernetes -pl !docs $JVM_TEST_MAVEN_ARGS ${{ steps.get-gib-args.outputs.gib_args }} | |
- name: Delete Local Artifacts From Cache | |
shell: bash | |
run: rm -r ~/.m2/repository/io/quarkus | |
- name: Clean Gradle temp directory | |
if: always() | |
shell: bash | |
run: devtools/gradle/gradlew --stop && rm -rf devtools/gradle/gradle-extension-plugin/build/tmp | |
- name: Prepare failure archive (if maven failed) | |
if: failure() | |
shell: bash | |
run: find . -name '*-reports' -type d -o -name '*.log' | tar -czf test-reports.tgz -T - | |
- name: Upload failure Archive (if maven failed) | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-reports-jvm${{matrix.java.name}} | |
path: 'test-reports.tgz' | |
retention-days: 5 | |
- name: Upload build reports (if build failed) | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() || cancelled() }} | |
with: | |
name: "build-reports-JVM Tests - JDK ${{matrix.java.name}}" | |
path: | | |
**/target/*-reports/TEST-*.xml | |
target/build-report.json | |
LICENSE.txt | |
retention-days: 2 | |
- name: Upload gc.log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "GC log - JDK ${{matrix.java.name}}" | |
path: | | |
**/windows-java-11.txt | |
!**/build/tmp/** | |
retention-days: 5 | |
- name: Upload build.log (if build failed) | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() || cancelled() }} | |
with: | |
name: "build-logs-JVM Tests - JDK ${{matrix.java.name}}" | |
path: | | |
**/build.log | |
retention-days: 2 | |