| # |
| # 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: |
| - master |
| - camel-master |
| - quarkus-master |
| - "[0-9]+.[0-9]+.x" |
| paths-ignore: |
| - '**.adoc' |
| - 'Jenkinsfile' |
| - 'KEYS' |
| - 'LICENSE.txt' |
| - 'NOTICE.txt' |
| pull_request: |
| branches: |
| - master |
| - camel-master |
| - quarkus-master |
| - "[0-9]+.[0-9]+.x" |
| paths-ignore: |
| - '**.adoc' |
| - 'Jenkinsfile' |
| - 'KEYS' |
| - 'LICENSE.txt' |
| - 'NOTICE.txt' |
| |
| env: |
| LANG: en_US.UTF-8 |
| MAVEN_OPTS: -Xmx3000m |
| MAVEN_ARGS: -V -ntp -Dhttp.keepAlive=false -e |
| |
| jobs: |
| initial-mvn-install: |
| if: github.repository == 'apache/camel-quarkus' |
| runs-on: ubuntu-latest |
| outputs: |
| matrix: ${{ steps.set-native-matrix.outputs.matrix }} |
| steps: |
| - name: Cancel Previous Runs |
| uses: n1hility/cancel-previous-runs@v2 |
| with: |
| token: ${{ secrets.GITHUB_TOKEN }} |
| - name: Check free space on disk |
| run: | |
| df -h / |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Set up JDK 11 |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| version: '11' |
| - name: Build Quarkus |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| git clone --depth 1 --branch master 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: | |
| ./mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} clean install -DskipTests -Dquarkus.build.skip |
| - name: Fail if there are uncommitted changes |
| shell: bash |
| run: | |
| [[ -z $(git status --porcelain) ]] || { 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: | |
| sudo wget -O /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64" |
| sudo chmod +x /usr/local/bin/yq |
| CATEGORIES=$(cat tooling/scripts/test-categories.yaml | yq r - --printMode p "*." | sed "s/\(.*\)/'\1'/" | sed ':a;N;$!ba;s/\n/,/g') |
| 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-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - name: Set up JDK 11 |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| 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: Install yq |
| run: | |
| sudo wget -O /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64" |
| sudo chmod +x /usr/local/bin/yq |
| - name: Integration Tests |
| env: |
| TEST_MODULES: ${{matrix.test-modules}} |
| run: | |
| TEST_MODULES="" |
| for MODULE in $(cat tooling/scripts/test-categories.yaml | yq r - "${{ matrix.category }}.*"); do |
| if [ "${MODULE}" == "-" ]; then |
| continue |
| fi |
| TEST_MODULES="${TEST_MODULES} ${MODULE}" |
| done |
| TEST_MODULES=$(echo ${TEST_MODULES} | sed 's/^[ \t]*//;s/[ \t]*$//') |
| |
| if [ -z "${TEST_MODULES}" ]; then |
| echo "No test modules were found for category ${{ matrix.category }}" |
| exit 1 |
| fi |
| |
| for i in $TEST_MODULES |
| do modules+=("integration-tests/$i"); done |
| IFS=, |
| eval ./mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} clean verify \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| -Pnative,docker,ci \ |
| -pl "${modules[*]}" |
| - 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') |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ '11' ] |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| 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 / |
| - 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 docs && mvn verify |
| 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: [ '8' , '11', '14' ] |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| 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 / |
| - name: cd extensions-jvm && mvn clean test |
| run: | |
| cd extensions-jvm |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| clean test |
| |
| integration-tests-alternative-jvm: |
| runs-on: ubuntu-latest |
| needs: initial-mvn-install |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM') |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ '8' , '14' ] |
| env: |
| MAVEN_OPTS: -Xmx3000m |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - uses: actions/checkout@v2 |
| - name: Set up JDK ${{ matrix.java }} |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| 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 / |
| - name: cd integration-tests && mvn clean verify |
| run: | |
| cd integration-tests |
| ../mvnw ${MAVEN_ARGS} ${BRANCH_OPTIONS} \ |
| -Dformatter.skip -Dimpsort.skip -Denforcer.skip \ |
| 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') |
| strategy: |
| fail-fast: false |
| matrix: |
| java: [ '8' , '11', '14' ] |
| steps: |
| - name: Setup apache-snapshots profile |
| if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master' |
| run: | |
| echo "BRANCH_OPTIONS=-s "$(pwd)"/settings-camel-3.7.0.xml" >> $GITHUB_ENV |
| - name: Setup oss-snapshots profile |
| if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master' |
| run: | |
| echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" >> $GITHUB_ENV |
| - name: Activate native tests on Java 11 |
| if: matrix.java == '11' |
| run: | |
| echo "MVN_TARGETS=-Pnative,docker clean verify" >> $GITHUB_ENV |
| - name: Do not activate native tests on Java non-11 |
| if: matrix.java != '11' |
| run: | |
| echo "MVN_TARGETS=clean test" >> $GITHUB_ENV |
| - name: Checkout |
| uses: actions/checkout@v2 |
| - name: Set up JDK 11 |
| uses: AdoptOpenJDK/install-jdk@v1 |
| with: |
| 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 / |
| - name: clone and verify examples |
| run: | |
| git clone --depth 1 --branch camel-quarkus-master https://github.com/apache/camel-quarkus-examples.git \ |
| && cd camel-quarkus-examples \ |
| && echo "Current Examples commit:" $(git rev-parse HEAD) \ |
| && ./mvnw-for-each.sh ${MAVEN_ARGS} ${BRANCH_OPTIONS} ${MVN_TARGETS} |
| |
| # memoryhogs: |
| # runs-on: ubuntu-latest |
| # needs: initial-mvn-install |
| # steps: |
| # - name: Checkout |
| # uses: actions/checkout@v2 |
| # - name: Set Up Java |
| # uses: actions/setup-java@v1 |
| # with: |
| # java-version: 1.8 |
| # - name: Download Maven Repo |
| # uses: actions/download-artifact@v1 |
| # with: |
| # name: maven-repo |
| # path: .. |
| # - name: Extract Maven Repo |
| # shell: bash |
| # run: tar -xzf ../maven-repo.tgz -C ~ |
| # # run the :camel-quarkus-integration-test-fhir as standalone process |
| # # as it building the native image including camel-fhir requires lot |
| # # of memory this we nee to limit it to avoid the process fail for OOM. |
| # - name: Integration Tests |
| # run: | |
| # ./mvnw ${MAVEN_ARGS} \ |
| # -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify \ |
| # -Dnative \ |
| # -Ddocker \ |
| # -DskipTests \ |
| # -Dnative-image.xmx=5g \ |
| # -pl :camel-quarkus-integration-test-fhir |