| # |
| # 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: Camel Quarkus CI |
| |
| on: |
| push: |
| branches: |
| - main |
| - camel-main |
| - quarkus-main |
| - "[0-9]+.[0-9]+.x" |
| paths-ignore: |
| - '**.adoc' |
| - 'Jenkinsfile' |
| - 'Jenkinsfile.*' |
| - 'KEYS' |
| - 'LICENSE.txt' |
| - 'NOTICE.txt' |
| pull_request: |
| branches: |
| - main |
| - camel-main |
| - quarkus-main |
| - "[0-9]+.[0-9]+.x" |
| paths-ignore: |
| - '**.adoc' |
| - 'Jenkinsfile' |
| - 'Jenkinsfile.*' |
| - 'KEYS' |
| - 'LICENSE.txt' |
| - 'NOTICE.txt' |
| |
| concurrency: |
| group: ${{ github.ref }}-${{ github.workflow }} |
| cancel-in-progress: true |
| |
| env: |
| LANG: en_US.UTF-8 |
| MAVEN_OPTS: -Xmx3000m |
| MAVEN_ARGS: -V -ntp -Dhttp.keepAlive=false -e |
| TESTCONTAINERS_RYUK_DISABLED: true |
| |
| jobs: |
| initial-mvn-install: |
| if: github.repository == 'apache/camel-quarkus' |
| runs-on: ubuntu-latest |
| outputs: |
| matrix: ${{ steps.set-native-matrix.outputs.matrix }} |
| env: |
| MAVEN_OPTS: -Xmx4000m |
| steps: |
| - name: Check free space on disk |
| run: | |
| df -h / |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots -pl '!docs'" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: '11' |
| - name: Build Quarkus |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| 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: Checkout |
| uses: actions/checkout@v2 |
| - name: mvn clean install -DskipTests |
| run: | |
| eval ./mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} clean install -DskipTests -Dquarkus.build.skip -Dskip.installyarn -Dskip.yarn |
| - name: Sync Maven properties |
| run: | |
| ./mvnw cq:sync-versions ${MAVEN_ARGS} -N |
| - name: Fail if there are uncommitted changes |
| shell: bash |
| run: | |
| [[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; exit 1; } |
| - name: Tar Maven Repo |
| shell: bash |
| run: | |
| tar -czf ${{ runner.temp }}/maven-repo.tgz -C ~ .m2/repository |
| ls -lh ${{ runner.temp }}/maven-repo.tgz |
| df -h / |
| - name: Persist Maven Repo |
| uses: actions/upload-artifact@v2 |
| with: |
| name: maven-repo |
| path: ${{ runner.temp }}/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}}" |
| |
| native-tests: |
| name: Native Tests - ${{matrix.category}} |
| needs: initial-mvn-install |
| runs-on: ubuntu-latest |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| strategy: |
| fail-fast: false |
| matrix: ${{ fromJson(needs.initial-mvn-install.outputs.matrix) }} |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - 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: | |
| df -h / |
| tar -xzf ../maven-repo.tgz -C ~ |
| df -h / |
| - 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: Fail if there are uncommitted changes |
| shell: bash |
| run: | |
| [[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; } |
| |
| functional-extension-tests-and-docs: |
| runs-on: ubuntu-latest |
| needs: initial-mvn-install |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - 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: | |
| df -h / |
| tar -xzf ../maven-repo.tgz -C ~ |
| df -h / |
| - name: cd extensions-core && mvn test |
| run: | |
| cd extensions-core |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip -Dcamel-quarkus.update-extension-doc-page.skip \ |
| test |
| - name: cd extensions && mvn test |
| run: | |
| cd extensions |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip -Dcamel-quarkus.update-extension-doc-page.skip \ |
| test |
| - name: cd test-framework && mvn test |
| run: | |
| cd test-framework |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip -Dcamel-quarkus.update-extension-doc-page.skip \ |
| test |
| - name: cd docs && mvn verify |
| if: github.ref != 'refs/heads/camel-main' && github.base_ref != 'camel-main' |
| run: | |
| cd docs |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| verify |
| |
| extensions-jvm-tests: |
| runs-on: ubuntu-latest |
| needs: initial-mvn-install |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ '11', '17' ] |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: ${{ matrix.java }} |
| - name: Download Maven Repo |
| uses: actions/download-artifact@v2 |
| with: |
| name: maven-repo |
| path: .. |
| - name: Extract Maven Repo |
| shell: bash |
| run: | |
| df -h / |
| tar -xzf ../maven-repo.tgz -C ~ |
| df -h / |
| hostname |
| hostname -f |
| hostname -A |
| HOSTS_LINE="127.0.0.1 $(hostname -f) $(hostname -A)" |
| echo "HOSTS_LINE=$HOSTS_LINE" |
| echo "${HOSTS_LINE}" | sudo tee -a /etc/hosts |
| cat /etc/hosts |
| - name: cd integration-tests-jvm && mvn clean test |
| run: | |
| cd integration-tests-jvm |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| --fail-at-end \ |
| clean test |
| |
| integration-tests-alternative-jdk: |
| runs-on: ubuntu-latest |
| needs: initial-mvn-install |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - 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 |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| with: |
| distribution: 'temurin' |
| java-version: '17' |
| - name: Download Maven Repo |
| uses: actions/download-artifact@v2 |
| with: |
| name: maven-repo |
| path: .. |
| - name: Extract Maven Repo |
| shell: bash |
| run: | |
| df -h / |
| tar -xzf ../maven-repo.tgz -C ~ |
| df -h / |
| - name: cd integration-tests && mvn clean verify |
| run: | |
| cd integration-tests |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| --fail-at-end \ |
| clean verify |
| |
| integration-tests-alternative-platform: |
| runs-on: ${{ matrix.os }} |
| needs: initial-mvn-install |
| strategy: |
| fail-fast: false |
| matrix: |
| os: [ 'windows-latest' ] |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| shell: bash |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| shell: bash |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - 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: cd integration-tests && mvn clean verify |
| shell: bash |
| run: | |
| cd integration-tests |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dskip-testcontainers-tests -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| --fail-at-end \ |
| clean verify |
| |
| examples-tests: |
| needs: initial-mvn-install |
| runs-on: ubuntu-latest |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-main' || github.base_ref == 'camel-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Papache-snapshots" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 'quarkus-main' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - 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: | |
| df -h / |
| tar -xzf ../maven-repo.tgz -C ~ |
| df -h / |
| - name: set CQ_VERSION |
| run: echo "CQ_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV |
| - name: clone and verify examples |
| run: | |
| EXAMPLES_BRANCH="camel-quarkus-main" |
| |
| if [[ ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.x ]]; then |
| EXAMPLES_BRANCH=${GITHUB_REF_NAME} |
| fi |
| |
| git clone --depth 1 --branch ${EXAMPLES_BRANCH} https://github.com/apache/camel-quarkus-examples.git \ |
| && cd camel-quarkus-examples \ |
| && echo "Current Examples commit:" $(git rev-parse HEAD) \ |
| && mvn ${MAVEN_ARGS} ${BRANCH_OPTIONS} org.l2x6.cq:cq-maven-plugin:2.10.0:examples-set-platform -Dcq.camel-quarkus.version=${CQ_VERSION} \ |
| && ./mvnw-for-each.sh ${MAVEN_ARGS} ${BRANCH_OPTIONS} -Pnative,docker clean verify |