321 lines
9.5 KiB
YAML
321 lines
9.5 KiB
YAML
name: CI build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk11
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Build
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew build --stacktrace
|
|
|
|
build-gradle-plugins:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Build
|
|
run: ../gradlew build --stacktrace
|
|
working-directory: gradle-plugins
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
test-java-version:
|
|
- 8
|
|
- 11
|
|
- 15
|
|
vm:
|
|
- hotspot
|
|
- openj9
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- id: setup-test-java
|
|
name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt-${{ matrix.vm }}
|
|
java-version: ${{ matrix.test-java-version }}
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk${{ matrix.test-java-version }}
|
|
read-only: true
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Test
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew test -PtestJavaVersion=${{ matrix.test-java-version }} -PtestJavaVM=${{ matrix.vm }} --stacktrace -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false
|
|
|
|
testLatestDeps:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
# Workaround https://github.com/burrunan/gradle-cache-action/issues/46
|
|
- name: Set dependencies cache key
|
|
shell: bash
|
|
run: echo "testLatestDeps" > gradle/otel-gradle-dependencies-key
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: latestDepTest
|
|
gradle-dependencies-cache-key: |
|
|
gradle/otel-gradle-dependencies-key
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Test
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
run: ./gradlew test -PtestLatestDeps=true --stacktrace
|
|
|
|
smoke-test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- windows-latest
|
|
- ubuntu-latest
|
|
smoke-test-suite:
|
|
- glassfish
|
|
- jetty
|
|
- liberty
|
|
- tomcat
|
|
- tomee
|
|
- wildfly
|
|
- other
|
|
fail-fast: false
|
|
steps:
|
|
- name: Support longpaths
|
|
run: git config --system core.longpaths true
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: smokeTests
|
|
read-only: true
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Test
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
# using --no-daemon because windows builds have been sporadically running out of virtual memory
|
|
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }} --no-daemon
|
|
|
|
setup-muzzle-matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- id: set-matrix
|
|
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q instrumentation:listInstrumentations | xargs echo | sed 's/ /","/g')\"]}"
|
|
|
|
muzzle:
|
|
needs: setup-muzzle-matrix
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix: ${{fromJson(needs.setup-muzzle-matrix.outputs.matrix)}}
|
|
fail-fast: false
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Run muzzle
|
|
# using retry because of sporadic gradle download failures
|
|
uses: nick-invision/retry@v2.4.1
|
|
with:
|
|
# timing out has not been a problem, these jobs typically finish in 2-3 minutes
|
|
timeout_minutes: 15
|
|
max_attempts: 3
|
|
command: ./gradlew ${{ matrix.module }}:muzzle
|
|
|
|
examples:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Local publish
|
|
run: ./gradlew publishToMavenLocal
|
|
|
|
- name: Build distro
|
|
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
working-directory: examples/distro
|
|
|
|
- name: Build extension
|
|
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
|
|
working-directory: examples/extension
|
|
|
|
snapshot:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build, test, testLatestDeps, smoke-test, examples ]
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Restore cache
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: jdk11
|
|
read-only: true
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Publish snapshot
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
|
|
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
|
|
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
|
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|
|
run: ./gradlew snapshot --stacktrace
|