| # |
| # 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. |
| # |
| |
| name: Daily Build Quarkus main |
| |
| on: |
| schedule: |
| # Run every day at 2AM |
| - cron: '0 2 * * *' |
| |
| env: |
| LANG: en_US.UTF-8 |
| MAVEN_OPTS: -Xmx3000m |
| MAVEN_ARGS: -V -ntp -Dhttp.keepAlive=false -e |
| TESTCONTAINERS_RYUK_DISABLED: true |
| ISSUE_ID: 2926 |
| |
| jobs: |
| initial-mvn-install: |
| if: github.repository == 'apache/camel-quarkus' |
| runs-on: ubuntu-latest |
| env: |
| MAVEN_OPTS: -Xmx4000m |
| outputs: |
| matrix: ${{ steps.set-native-matrix.outputs.matrix }} |
| steps: |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: '11' |
| - name: Clean VM |
| run: | |
| echo "Removing unwanted SDKs" |
| sudo rm -rf /usr/local/lib/android \ |
| rm -rf /usr/local/share/boost \ |
| rm -rf /usr/local/go \ |
| rm -rf /usr/share/dotnet \ |
| rm -rf /usr/share/rust |
| |
| echo "Available disk space:" |
| df -h |
| - name: Set Workflow Build ID |
| run: | |
| [ ! -d ~/build-data ] && mkdir -p ~/build-data |
| echo "${{ github.run_id }}-${{ github.run_number }}-$(uuidgen)" > ~/build-data/build-id.txt |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| ref: quarkus-main |
| fetch-depth: 0 |
| - name: Rebase branch main onto quarkus-main |
| run: | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| git config --local user.name "github-actions[bot]" |
| git fetch origin main |
| git rebase origin/main |
| git rev-parse origin/main > ~/build-data/main-sha.txt |
| - name: Build Quarkus |
| run: | |
| git clone --depth 1 --branch main https://github.com/quarkusio/quarkus.git \ |
| && cd quarkus \ |
| && echo "Current Quarkus commit:" $(git rev-parse HEAD) \ |
| && ./mvnw ${MAVEN_ARGS} clean install -Dquickly |
| - name: Build Camel Quarkus |
| run: | |
| ./mvnw ${MAVEN_ARGS} clean install -Dquarkus.version=999-SNAPSHOT -pl '!docs' --fail-at-end |
| - name: Tar Maven Repo |
| shell: bash |
| run: | |
| tar -czf maven-repo.tgz -C ~ build-data .m2/repository |
| ls -lh maven-repo.tgz |
| df -h |
| - name: Persist Maven Repo |
| uses: actions/upload-artifact@v2 |
| with: |
| name: maven-repo |
| path: maven-repo.tgz |
| retention-days: 1 |
| - name: Setup Native Test Matrix |
| id: set-native-matrix |
| run: | |
| CATEGORIES=$(yq -M -N -I 0 -o=json e 'keys' tooling/scripts/test-categories.yaml | tr '"' "'") |
| echo "::set-output name=matrix::{'category': ${CATEGORIES}}" |
| - name: Report Build Failure |
| if: failure() |
| run: | |
| # Abort rebase in case something went wrong as we may have broken pom.xml files |
| if [[ -e ".git/rebase" || -e ".git/rebase-apply" || -e ".git/rebase-merge" ]]; then |
| git rebase --abort |
| fi |
| |
| ./mvnw ${MAVEN_ARGS} verify -N -Pbuild-notification -Dstatus=${{ job.status }} -DissueId=${{ env.ISSUE_ID }} -Dtoken=${{ secrets.GITHUB_TOKEN }} -DbuildId=$(cat ~/build-data/build-id.txt) -Drepo=${GITHUB_REPOSITORY} -Dbranch=quarkus-main -Dbranch-commit=$(cat ~/build-data/main-sha.txt) |
| |
| native-tests: |
| name: Native Tests - ${{matrix.category}} |
| needs: initial-mvn-install |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: ${{ fromJson(needs.initial-mvn-install.outputs.matrix) }} |
| steps: |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: '11' |
| - name: Download Maven Repo |
| uses: actions/download-artifact@v2 |
| with: |
| name: maven-repo |
| path: . |
| - name: Extract Maven Repo |
| shell: bash |
| run: tar -xzf maven-repo.tgz -C ~ |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| ref: quarkus-main |
| fetch-depth: 0 |
| - name: Rebase branch main onto quarkus-main |
| run: | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| git config --local user.name "github-actions[bot]" |
| git fetch origin main |
| git rebase $(cat ~/build-data/main-sha.txt) |
| - name: Integration Tests |
| run: | |
| for MODULE in $(yq -M -N e ".${{ matrix.category }}" tooling/scripts/test-categories.yaml | cut -f2 -d' '); do |
| if [[ "${MODULE}" == "null" ]]; then |
| continue |
| fi |
| |
| MODULE="integration-tests/$(echo ${MODULE} | sed 's/^[ \t]*//;s/[ \t]*$//')" |
| |
| if [[ "x$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=ci.native.tests.skip -DforceStdout -q -f ${MODULE})" == "xtrue" ]]; then |
| JVM_MODULES+=("${MODULE}") |
| else |
| NATIVE_MODULES+=("${MODULE}") |
| fi |
| done |
| |
| if [[ ${#JVM_MODULES[@]} -eq 0 && ${#NATIVE_MODULES[@]} -eq 0 ]]; then |
| echo "No test modules were found for category ${{ matrix.category }}" |
| exit 1 |
| fi |
| |
| IFS=, |
| if [[ ${JVM_MODULES[@]} ]]; then |
| eval ./mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} clean test \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| -Pdocker,ci \ |
| -pl "${JVM_MODULES[*]}" |
| fi |
| |
| if [[ ${NATIVE_MODULES[@]} ]]; then |
| eval ./mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} clean verify \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| -Pnative,docker,ci \ |
| --fail-at-end \ |
| -pl "${NATIVE_MODULES[*]}" |
| fi |
| - name: Report Build Failure |
| if: failure() |
| run: | |
| ./mvnw ${MAVEN_ARGS} verify -N -Pbuild-notification -Dstatus=${{ job.status }} -DissueId=${{ env.ISSUE_ID }} -Dtoken=${{ secrets.GITHUB_TOKEN }} -DbuildId=$(cat ~/build-data/build-id.txt) -Drepo=${GITHUB_REPOSITORY} -Dbranch=quarkus-main -Dbranch-commit=$(cat ~/build-data/main-sha.txt) |
| |
| handle-build-status: |
| needs: native-tests |
| runs-on: ubuntu-latest |
| steps: |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: '11' |
| - name: Download Maven Repo |
| uses: actions/download-artifact@v2 |
| with: |
| name: maven-repo |
| path: . |
| - name: Extract Maven Repo |
| shell: bash |
| run: tar -xzf maven-repo.tgz -C ~ |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| ref: quarkus-main |
| fetch-depth: 0 |
| - name: Rebase branch main onto quarkus-main |
| run: | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| git config --local user.name "github-actions[bot]" |
| git fetch origin main |
| git rebase $(cat ~/build-data/main-sha.txt) |
| - name: Report build status |
| id: report |
| run: | |
| ./mvnw ${MAVEN_ARGS} verify -N -Pbuild-notification -Dstatus=verify -DissueId=${{ env.ISSUE_ID }} -Dtoken=${{ secrets.GITHUB_TOKEN }} -DbuildId=$(cat ~/build-data/build-id.txt) -Drepo=${GITHUB_REPOSITORY} -Dbranch=quarkus-main -Dbranch-commit=$(cat ~/build-data/main-sha.txt) |
| - name: Sync branch main to quarkus-main |
| if: steps.report.outputs.overall_build_status == 'success' |
| run: | |
| git push --force-with-lease origin quarkus-main |