Skip to content

Update all github actions (major) #651

Update all github actions (major)

Update all github actions (major) #651

name: Build and test
on:
pull_request:
push:
branches:
- 'main'
env:
GRADLE_OPTS: -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.welcome=never
PGP_SEC: ${{ secrets.PGP_SEC }}
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
jobs:
build_and_test_with_code_coverage:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
steps:
# actions/checkout v1.* is needed for correct codecov upload, see https://github.com/actions/checkout/issues/237 for details
- uses: actions/checkout@v4
# ensure that gradle wrapper files in repository are valid by checking checksums
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
- name: Cache konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-konan
restore-keys: |
${{ runner.os }}-gradle-konan
- name: Gradle build with remote cache
uses: burrunan/gradle-cache-action@v1
with:
arguments: |
build
-x detekt
properties: |
org.gradle.caching=true
gradle-version: wrapper
# additional files to calculate key for dependency cache
gradle-dependencies-cache-key: |
buildSrc/**/Versions.kt
- name: Upload gradle reports
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: gradle-reports-${{ matrix.os }}
path: '**/build/reports/'
- name: Code coverage report
#if: ${{ runner.os == 'Linux' }}
if: ${{ false }}
uses: codecov/codecov-action@v4
with:
flags: unittests
fail_ci_if_error: true # optional (default = false)
- name: 'Publish a snapshot'
id: publish
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref == 'refs/heads/main' }}
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
arguments: |
publish
-Preckon.stage=snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}