3.x Examples validation flow for external examples repo #632
Workflow file for this run
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
# Notes | |
# - cannot run on Windows, as we use shell scripts | |
# - removed macos-latest from most jobs to speed up the process | |
name: "Validate" | |
on: | |
pull_request: | |
branches-ignore: | |
- 'release-*' | |
- 'test-release-*' | |
push: | |
branches-ignore: | |
- 'release-*' | |
- 'test-release-*' | |
workflow_call: | |
env: | |
JAVA_VERSION: '17' | |
JAVA_DISTRO: 'oracle' | |
MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3' | |
HELIDON_EXAMPLES_REPOSITORY: 'helidon/helidon-examples.git' # external examples repository | |
HELIDON_EXAMPLES_BUILD_BRANCH: 'dev-3.x' # validation branch for examples | |
HELIDON_EXAMPLES_CHECKOUT_FOLDER: 'examples_ex' # local checkout folder for validation branch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
copyright: | |
timeout-minutes: 10 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Copyright | |
run: etc/scripts/copyright.sh | |
checkstyle: | |
timeout-minutes: 10 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Checkstyle | |
run: etc/scripts/checkstyle.sh | |
spotbugs: | |
timeout-minutes: 45 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Spotbugs | |
run: etc/scripts/spotbugs.sh | |
build: | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Maven build | |
run: etc/scripts/github-build.sh | |
- name: Archive Test results | |
uses: actions/[email protected] | |
if: always() | |
with: | |
name: test-results | |
path: | | |
**/target/surefire-reports/*.txt | |
**/target/it/**/*.log | |
docs: | |
timeout-minutes: 10 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Docs | |
run: etc/scripts/site.sh | |
tck: | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Maven build | |
run: etc/scripts/github-tck.sh | |
examples: | |
timeout-minutes: 30 | |
continue-on-error: true | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Maven build | |
run: | | |
mvn -B -e "-Dmaven.test.skip=true" $MAVEN_HTTP_ARGS -DskipTests -Ppipeline install | |
- name: Examples checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
repository: ${{ env.HELIDON_EXAMPLES_REPOSITORY }} | |
ref: ${{ env.HELIDON_EXAMPLES_BUILD_BRANCH }} | |
path: ${{ env.HELIDON_EXAMPLES_CHECKOUT_FOLDER }} | |
- name: Examples build | |
run: | | |
HELIDON_VERSION=`cat ${{ env.HELIDON_EXAMPLES_CHECKOUT_FOLDER }}/pom.xml | grep "<helidon.version>" | cut -d">" -f 2 | cut -d"<" -f 1` | |
HELIDON_VERSION_IN_REPO=`cat bom/pom.xml | grep "<helidon.version>" | cut -d">" -f 2 | cut -d"<" -f 1` | |
if [ ${HELIDON_VERSION} != ${HELIDON_VERSION_IN_REPO} ]; then | |
exit 78 | |
fi | |
cd ${{ env.HELIDON_EXAMPLES_CHECKOUT_FOLDER }} | |
mvn -B clean install || exit 78 | |
archetypes: | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Test archetypes | |
run: etc/scripts/test-archetypes.sh | |
packaging: | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 22.3.1 | |
java-version: 17 | |
components: native-image | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: true | |
set-java-home: false | |
cache: maven | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRO }} | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: Build Helidon | |
run: etc/scripts/github-compile.sh | |
- name: JAR packaging | |
run: etc/scripts/test-packaging-jar.sh | |
- name: JLink packaging | |
run: etc/scripts/test-packaging-jlink.sh | |
- name: Native-Image packaging | |
run: etc/scripts/test-packaging-native.sh |