Skip to content

Merge pull request #522 from project-ncl/dependabot/github_actions/ac… #1014

Merge pull request #522 from project-ncl/dependabot/github_actions/ac…

Merge pull request #522 from project-ncl/dependabot/github_actions/ac… #1014

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
pull_request:
branches:
- main
paths-ignore:
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
jobs:
gradle-wrapper-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: gradle/wrapper-validation-action@v3
check-java-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Remove default github maven configuration
# This step is a workaround to avoid a decryption issue of Beam's
# net.linguica.gradle.maven.settings plugin and github's provided maven
# settings.xml file
run: rm ~/.m2/settings.xml
- name: Check Java formatting
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
gradle-version: 8.3
arguments: --no-daemon --stacktrace spotlessJavaCheck
build-gradle-1:
needs: [gradle-wrapper-validation, check-java-formatting]
strategy:
fail-fast: false
matrix:
gradle: [4.10.3, "5.0", 5.1.1, 5.2.1, 5.3.1, 5.4.1, 5.5.1, 5.6.4, 6.0.1, 6.1.1, 6.2.2, 6.3, 6.4.1, 6.5.1, 6.6.1, 6.7.1, 6.8.3, 6.9.4, 7.0.2, 7.1.1, 7.2, 7.3.3, 7.4.2, 7.5.1, 7.6.6, 8.0.2, 8.1.1, 8.2.1]
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif
if: github.repository == 'project-ncl/gradle-manipulator' && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
- name: Remove default github maven configuration
# This step is a workaround to avoid a decryption issue of Beam's
# net.linguica.gradle.maven.settings plugin and github's provided maven
# settings.xml file
run: rm ~/.m2/settings.xml
- name: Fix build for Gradle ${{ matrix.gradle }}
run: ./gradle/fix-build.sh ${{ matrix.gradle }}
- uses: gradle/gradle-build-action@v3
with:
gradle-version: ${{ matrix.gradle }}
arguments: --no-daemon --stacktrace clean build AggregateJacocoReport
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
- name: Codecov
uses: codecov/codecov-action@v5
with:
files: ./build/reports/jacoco/aggregate/jacocoTestReport.xml
verbose: true
build-gradle-2:
needs: [gradle-wrapper-validation, check-java-formatting]
strategy:
fail-fast: false
matrix:
gradle: [8.3, 8.4, 8.5, 8.8, "8.10.2", "8.12.1", "8.13", "8.14.3", "9.0.0", "9.1.0"]
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif
if: github.repository == 'project-ncl/gradle-manipulator' && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Remove default github maven configuration
# This step is a workaround to avoid a decryption issue of Beam's
# net.linguica.gradle.maven.settings plugin and github's provided maven
# settings.xml file
run: rm ~/.m2/settings.xml
- uses: gradle/gradle-build-action@v3
with:
gradle-version: ${{ matrix.gradle }}
arguments: --no-daemon --stacktrace clean build AggregateJacocoReport
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
- name: Codecov
uses: codecov/codecov-action@v5
with:
files: ./build/reports/jacoco/aggregate/jacocoTestReport.xml
verbose: true
snapshot:
if: github.repository == 'project-ncl/gradle-manipulator' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: gradle/wrapper-validation-action@v3
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Remove default github maven configuration
# This step is a workaround to avoid a decryption issue of Beam's
# net.linguica.gradle.maven.settings plugin and github's provided maven
# settings.xml file
run: rm ~/.m2/settings.xml
# https://github.com/marketplace/actions/maven-setings-action
- name: Maven Settings
uses: s4u/maven-settings-action@v4.0.0
with:
sonatypeSnapshots: true
githubServer: false
servers: |
[{
"id": "central",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
- name: Extract Project version
id: project-version
run: echo "version=$(cat gradle.properties | awk -F "=" 'BEGIN{ORS=""} /version/{print $NF}')" >> "$GITHUB_OUTPUT"
- uses: gradle/gradle-build-action@v3
if: ${{ endsWith(steps.project-version.outputs.version, '-SNAPSHOT') }}
with:
arguments: build publishToCentral -x test -x funcTest