Skip to content

Coverage

Coverage #5

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Coverage"
on:
push:
branches:
- '[0-9]+.[0-9]+.x'
- '8.0.x-hibernate7.*'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
coverage-core:
name: "Coverage - grails-core (${{ matrix.os }})"
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v6
- name: "β˜•οΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 21
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🌑️ Run tests with coverage"
run: >
./gradlew jacocoAggregateReport
--continue
--stacktrace
-PskipCodeStyle
- name: "πŸ“€ Upload coverage artifact"
uses: actions/upload-artifact@v7.0.1
with:
name: coverage-core-${{ matrix.os }}
path: build/reports/jacoco/aggregate/jacocoAggregateReport.xml
if-no-files-found: warn
coverage-gradle:
name: "Coverage - grails-gradle (${{ matrix.os }})"
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v6
- name: "β˜•οΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 21
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🌑️ Run tests with coverage"
working-directory: grails-gradle
run: >
./gradlew jacocoAggregateReport
--continue
--stacktrace
-PskipCodeStyle
- name: "πŸ“€ Upload coverage artifact"
uses: actions/upload-artifact@v7.0.1
with:
name: coverage-gradle-${{ matrix.os }}
path: grails-gradle/build/reports/jacoco/aggregate/jacocoAggregateReport.xml
if-no-files-found: warn
upload-coverage:
name: "Upload Coverage to Codecov"
needs: [coverage-core, coverage-gradle]
# Run even if some matrix legs fail so partial coverage is still uploaded
if: always()
runs-on: ubuntu-24.04
steps:
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v6
- name: "πŸ“₯ Download all coverage artifacts"
uses: actions/download-artifact@v7.0.0
with:
path: coverage-reports
- name: "πŸ“Š Upload coverage to Codecov"
continue-on-error: true
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage-reports
verbose: true