mirror of https://github.com/apache/jmeter.git
109 lines
4.1 KiB
YAML
109 lines
4.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
|
|
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners
|
|
|
|
concurrency:
|
|
# On master/release, we don't want any jobs cancelled so the sha is used to name the group
|
|
# On PR branches, we cancel the job if new commits are pushed
|
|
# More info: https://stackoverflow.com/a/68422069/253468
|
|
group: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' ) && format('ci-main-{0}', github.sha) || format('ci-main-{0}', github.ref) }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
matrix_prep:
|
|
name: Matrix Preparation
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
env:
|
|
# Number of jobs to generate in matrix.js
|
|
MATRIX_JOBS: 4
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- id: set-matrix
|
|
run: |
|
|
node .github/workflows/matrix.js
|
|
|
|
test:
|
|
needs: matrix_prep
|
|
name: '${{ matrix.name }}'
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
TZ: ${{ matrix.tz }}
|
|
strategy:
|
|
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
|
|
fail-fast: false
|
|
# max-parallel: 4
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 50
|
|
- name: Set up Java ${{ matrix.java_version }}, oracle
|
|
if: ${{ matrix.oracle_java_website != '' }}
|
|
uses: oracle-actions/setup-java@b1546e588c27008e88bfcabda44d11c22316b9b8 # v1.4.2
|
|
with:
|
|
website: ${{ matrix.oracle_java_website }}
|
|
release: ${{ matrix.java_version }}
|
|
- name: Set up Java 17 and ${{ matrix.non_ea_java_version }}, ${{ matrix.java_distribution }}
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
# The latest one will be the default, so we use Java 17 for launching Gradle
|
|
java-version: |
|
|
${{ matrix.non_ea_java_version }}
|
|
17
|
|
distribution: ${{ matrix.java_distribution }}
|
|
architecture: x64
|
|
- name: Steps to reproduce
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
console.log('The following command might help reproducing CI results, use Java ${{ matrix.java_version }}')
|
|
console.log('TZ="${{ matrix.tz }}" _JAVA_OPTIONS="${{ matrix.extraJvmArgs }}" ./gradlew build -x distTar -x distTarSource -x distTarSha512 -x distTarSourceSha512 ${{ matrix.extraGradleArgs }} -PtestExtraJvmArgs="${{ matrix.testExtraJvmArgs }}" -PtestDisableCaching="${{ matrix.testDisableCaching }}"')
|
|
- uses: burrunan/gradle-cache-action@v3
|
|
name: Test
|
|
with:
|
|
job-id: jdk${{ matrix.java_version }}
|
|
multi-cache-enabled: false
|
|
# An explicit skip for Sha512 tasks is required due to https://github.com/gradle/gradle/issues/16789
|
|
arguments: --scan --no-parallel build -x distTar -x distTarSource -x distTarSha512 -x distTarSourceSha512 ${{ matrix.extraGradleArgs }}
|
|
properties: |
|
|
testExtraJvmArgs=${{ matrix.testExtraJvmArgs }}
|
|
testDisableCaching=${{ matrix.testDisableCaching }}
|
|
jdkBuildVersion=17
|
|
jdkTestVersion=${{ matrix.java_version }}
|
|
jdkTestVendor=${{ matrix.java_vendor }}
|
|
# We have a separate job with Errorprone verifications, so avoid duplicate warnings
|
|
enableErrorprone=false
|
|
# We provision JDKs with GitHub Actions for caching purposes, so Gradle should rather fail in case JDK is not found
|
|
org.gradle.java.installations.auto-download=false
|
|
env:
|
|
_JAVA_OPTIONS: ${{ matrix.extraJvmArgs }}
|
|
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
|
|
|
errorprone:
|
|
name: 'Error Prone (JDK 17)'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: 'Set up JDK 17'
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 17
|
|
distribution: 'zulu'
|
|
- uses: burrunan/gradle-cache-action@v3
|
|
name: Test
|
|
with:
|
|
job-id: errprone
|
|
multi-cache-enabled: false
|
|
arguments: --scan --no-parallel --no-daemon classes
|
|
env:
|
|
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|