Skip to content

Update Gradle to 8.6, switch to new Gradle GH actions #384

Update Gradle to 8.6, switch to new Gradle GH actions

Update Gradle to 8.6, switch to new Gradle GH actions #384

Workflow file for this run

name: Build and test
on:
pull_request:
push:
branches:
- 'main'
jobs:
build_and_test_with_code_coverage:
name: Build, test and upload code coverage
runs-on: ubuntu-22.04
env:
CI: true
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- uses: gradle/actions/setup-gradle@v3
name: Setup Gradle
with:
gradle-version: wrapper
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: build and test
run: ./gradlew check build -x detekt -Pdetekt.multiplatform.disabled=true --scan --configuration-cache
- name: Upload test reports
if: ${{ failure() }} # runs only if previous step has failed, the entire workflow will still be marked as failed
uses: actions/upload-artifact@v4
with:
name: gradle-test-report
path: '**/build/reports/'
- name: Code coverage report
uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: true # optional (default = false)
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- uses: gradle/gradle-build-action@v2
name: run detekt
with:
arguments: check -Pdetekt.multiplatform.disabled=false -PdetektAutoCorrect=true
gradle-version: wrapper
- run: git status && git diff
if: ${{ always() }}
- uses: reviewdog/action-suggester@v1
# Fixme: run if only the previous step has failed
if: ${{ failure() }}
with:
tool_name: detekt