feat: Allow LooperMode annotation on nested tests and test methods (#59) #205
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 with Gradle | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
type: string | |
description: New version for the release. When empty release publishing skipped. | |
default: '' | |
required: true | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ 'main' ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
actions: write | |
contents: read | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- name: Set up JDK | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version-file: '.java-version' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 | |
- name: Bump version | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.releaseVersion != '' | |
run: | | |
./bumpVersion.sh "${RELEASE_VERSION}" | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | |
- name: Publish Gradle Plugin to Maven Local | |
run: | | |
./gradlew :robolectric-extension-gradle-plugin:publishToMavenLocal --configure-on-demand | |
env: | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD }}' | |
- name: Build with Gradle Wrapper | |
run: | | |
./gradlew build koverXmlReport publish | |
env: | |
JUNIT5_ROBOLECTRIC_EXTENSION_MAVEN_USERNAME: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_MAVEN_USERNAME }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_MAVEN_PASSWORD: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_MAVEN_PASSWORD }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD }}' | |
- name: Publish Gradle Plugin | |
run: | | |
./publishGradlePlugin.sh | |
env: | |
JUNIT5_ROBOLECTRIC_EXTENSION_GRADLE_PLUGIN_PORTAL_KEY: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GRADLE_PLUGIN_PORTAL_KEY }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GRADLE_PLUGIN_PORTAL_SECRET: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GRADLE_PLUGIN_PORTAL_SECRET }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_KEY }}' | |
JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD: '${{ secrets.JUNIT5_ROBOLECTRIC_EXTENSION_GPG_SIGNING_PASSWORD }}' | |
- name: Upload coverage report | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
if: ${{ hashFiles('build/reports/kover/report.xml') != '' }} | |
with: | |
name: kover-report | |
path: ${{ github.workspace }}/build/reports/kover/report.xml | |
retention-days: 5 | |
release: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
needs: | |
- build | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.releaseVersion != '' && !endsWith(github.event.inputs.releaseVersion, 'SNAPSHOT') | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- name: Create release | |
shell: bash | |
run: | | |
git config --global user.name "${GIT_USER_NAME}" | |
git config --global user.email "${GIT_USER_EMAIL}" | |
./tagRelease.sh "${RELEASE_VERSION}" | |
env: | |
GIT_USER_NAME: ${{ github.actor }} | |
GIT_USER_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com | |
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | |
kover: | |
runs-on: ubuntu-22.04 | |
needs: | |
- build | |
permissions: | |
actions: read | |
checks: write | |
contents: read | |
pull-requests: write | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Download coverage report | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
name: kover-report | |
- name: Comment branch coverage report to PR | |
uses: mi-kas/kover-report@5f58465b6f395c8fa3adc2665e27250bad87de50 # v1.9 | |
if: ${{ hashFiles('report.xml') != '' }} | |
with: | |
path: ${{ github.workspace }}/report.xml | |
title: Branch Coverage | |
update-comment: true | |
min-coverage-overall: 60 | |
min-coverage-changed-files: 70 | |
coverage-counter-type: BRANCH | |
- name: Comment line coverage report to PR | |
uses: mi-kas/kover-report@5f58465b6f395c8fa3adc2665e27250bad87de50 # v1.9 | |
if: ${{ hashFiles('report.xml') != '' }} | |
with: | |
path: ${{ github.workspace }}/report.xml | |
title: Line Coverage | |
update-comment: true | |
min-coverage-overall: 60 | |
min-coverage-changed-files: 70 | |
coverage-counter-type: LINE |