build(deps): bump gradle/actions from 3.4.2 to 3.5.0 #1287
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
name: Build CI | |
on: | |
push: | |
tags: [ '[0-9]+.[0-9]+.[0-9]+' ] | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
types: [ opened, reopened, synchronize ] | |
paths: | |
- .github/workflows/** | |
- gradle/** | |
- kata/** | |
- build.gradle.kts | |
- settings.gradle.kts | |
- gradle.properties | |
workflow_dispatch: | |
inputs: | |
ref_name: | |
description: Branch, tag or SHA to checkout | |
job_count: | |
description: Max concurrent jobs to execute | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
fork: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 1 | |
outputs: | |
job_count: ${{ steps.job.outputs.count }} | |
job_sid: ${{ steps.job.outputs.sid }} | |
steps: | |
- name: Assign job IDs | |
id: job | |
run: | | |
# set default as inputs resolve only at manual executions | |
JOB_COUNT=${{ github.event.inputs.job_count || 40 }} | |
echo "count=$JOB_COUNT" >> $GITHUB_OUTPUT | |
echo "sid=[`seq -s , 1 $JOB_COUNT`]" >> $GITHUB_OUTPUT | |
# ------------------------ | |
test: | |
needs: fork | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 8 | |
strategy: | |
matrix: | |
job_sid: ${{ fromJSON(needs.fork.outputs.job_sid) }} | |
steps: | |
- name: Checkout repository (default ref) | |
if: ${{ github.event.inputs.ref_name == '' }} | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Checkout repository (custom ref) | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
if: ${{ github.event.inputs.ref_name != '' }} | |
with: | |
ref: ${{ github.event.inputs.ref_name }} | |
- name: Setup Java | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Test project | |
run: | | |
./gradlew test jacocoTestReport -x processResources -x processTestResources \ | |
--parallel \ | |
--configuration-cache \ | |
--build-cache \ | |
--no-daemon \ | |
--scan \ | |
-DforkCount=${{ needs.fork.outputs.job_count }} \ | |
-DforkSid=${{ matrix.job_sid }} | |
- name: Pack fork artifacts | |
run: | | |
find . -path "*/main/*.class" -o -path "*/test/*.class" -o -path "*/jacocoTestReport.xml" > artifacts | |
tar czfT artifacts.tar.gz artifacts | |
- name: Upload fork artifacts | |
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
with: | |
name: fork-${{ matrix.job_sid }} | |
retention-days: 1 | |
path: artifacts.tar.gz | |
# ------------------------ | |
scan: | |
needs: test | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
VERSION: 1.23.0 | |
steps: | |
- name: Checkout repository (default ref) | |
if: ${{ github.event.inputs.ref_name == '' }} | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Checkout repository (custom ref) | |
if: ${{ github.event.inputs.ref_name != '' }} | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.event.inputs.ref_name }} | |
- name: Download fork artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
- name: Unpack fork artifacts | |
run: for f in fork-*/artifacts.tar.gz; do tar xf $f && rm $f; done | |
- name: Setup Java | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0 | |
with: | |
gradle-home-cache-cleanup: true | |
add-job-summary-as-pr-comment: always | |
- name: Analyze code quality | |
run: | | |
./gradlew sonar -x compileJava -x compileTestJava \ | |
--parallel \ | |
--configuration-cache \ | |
--build-cache \ | |
--no-daemon \ | |
--scan \ | |
-Pversion=${{ format('{0}+{1}', env.VERSION, github.RUN_NUMBER) }} \ | |
-Dsonar.host.url=https://sonarcloud.io \ | |
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \ | |
-Dsonar.organization=${{ secrets.SONAR_KEY }} \ | |
-Dsonar.qualitygate.wait=true \ | |
-Dsonar.gradle.skipCompile=true |