Skip to content

Bump codecov/codecov-action from 4 to 5 (#204) #605

Bump codecov/codecov-action from 4 to 5 (#204)

Bump codecov/codecov-action from 4 to 5 (#204) #605

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: CI
env:
MIN_JDK: '17'
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
codacy-analysis-cli:
runs-on: ubuntu-latest
name: Codacy Analysis CLI
steps:
- uses: actions/checkout@v4
- name: Run codacy-analysis-cli
uses: codacy/codacy-analysis-cli-action@master
build:
name: ${{ matrix.os }} / OpenJDK ${{ matrix.jdk }}
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
ORG_GRADLE_PROJECT_sonarToken: ${{ secrets.SONAR_TOKEN || '**undefined**' }}
strategy:
matrix:
jdk: ['17', '21', '22']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build without sonar
if: ${{ env.ORG_GRADLE_PROJECT_sonarToken == '**undefined**' || matrix.jdk != env.MIN_JDK }}
run: ./gradlew check
- name: Build with sonar
if: ${{ env.ORG_GRADLE_PROJECT_sonarToken != '**undefined**' }}
run: ./gradlew check sonar
- name: Run codecov analysis
uses: codecov/codecov-action@v5
deploy:
if: ${{ github.event_name != 'pull_request' && github.repository == 'xmldb-org/xmldb-api' }}
needs: [ build, codacy-analysis-cli ]
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.MIN_JDK }}
- name: Deploy
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publish --no-daemon