Skip to content

CI

CI #554

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
jdk: [ '17', '21', '22' ]
runs-on: ubuntu-latest
name: "Build (JDK ${{ matrix.jdk }})"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
id: setup-gradle-jdk
with:
distribution: liberica
java-version: 17
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
if: matrix.jdk != '17'
with:
distribution: liberica
java-version: ${{ matrix.jdk }}
- name: 'Prepare TOOLCHAIN_JDK env var'
if: matrix.jdk != '17'
shell: bash
run: echo "TOOLCHAIN_JDK=$JAVA_HOME" >> $GITHUB_ENV
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
- shell: bash
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
run: |
./gradlew \
-Porg.gradle.java.installations.auto-download=false \
"-Dscan.value.GitHub job=${{ github.job }}" \
-Dscan.tag.JDK_${{ matrix.jdk }} \
-PjavaToolchainVersion=${{ matrix.jdk }} \
--scan \
--refresh-dependencies \
javaToolchains \
build
ea-build:
strategy:
matrix:
jdk: [ '23' ]
runs-on: ubuntu-latest
name: "Early Access Build (JDK ${{ matrix.jdk }})"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
id: setup-gradle-jdk
with:
distribution: liberica
java-version: 17
- uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.jdk }}
version: latest
- name: 'Prepare TOOLCHAIN_JDK env var'
if: matrix.jdk != '17'
shell: bash
run: echo "TOOLCHAIN_JDK=$JAVA_HOME" >> $GITHUB_ENV
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
- shell: bash
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
run: |
./gradlew \
-Porg.gradle.java.installations.auto-download=false \
"-Dscan.value.GitHub job=${{ github.job }}" \
-Dscan.tag.JDK_${{ matrix.jdk }} \
-PjavaToolchainVersion=${{ matrix.jdk }} \
--scan \
--refresh-dependencies \
javaToolchains \
build
publish:
name: Publish Snapshots
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'junit-team/testng-engine' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
with:
distribution: liberica
java-version: 17
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4
- shell: bash
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
run: |
./gradlew \
-Porg.gradle.java.installations.auto-download=false \
"-Dscan.value.GitHub job=${{ github.job }}" \
-Dscan.tag.publish \
--scan \
javaToolchains \
publish \
-x check \
--no-configuration-cache