-
Notifications
You must be signed in to change notification settings - Fork 24
76 lines (72 loc) · 2.38 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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/actions/wrapper-validation@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- 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@v2
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 }}