-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (81 loc) · 2.8 KB
/
continuous-integration.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
77
78
79
80
81
82
83
84
name: 'Continuous Integration'
on: [pull_request, push]
permissions: read-all
jobs:
ci-pipeline:
name: 'Continuous Integration'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: 'Set environment'
run: |
if [[ ${GITHUB_REF} == 'refs/heads/main' ]]; then
echo 'SCAN=--scan' >> ${GITHUB_ENV}
fi
- name: 'Install system packages'
run: sudo apt-get install -y --no-install-recommends clang gcc make sed tcl
- uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: true
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: 'Build cache'
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/OpenSSL/build
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 'ccache'
uses: hendrikmuhs/[email protected]
- name: 'Gradle configuration'
run: |
echo 'org.gradle.caching=true' >> gradle.properties
echo 'plugins {' >> settings.gradle.kts
echo ' id("com.gradle.enterprise").version("3.6.3")' >> settings.gradle.kts
echo '}' >> settings.gradle.kts
echo 'gradleEnterprise {' >> settings.gradle.kts
echo ' buildScan {' >> settings.gradle.kts
echo ' termsOfServiceUrl = "https://gradle.com/terms-of-service"' >> settings.gradle.kts
echo ' termsOfServiceAgree = "yes"' >> settings.gradle.kts
echo ' }' >> settings.gradle.kts
echo '}' >> settings.gradle.kts
- name: 'Licenses'
run: ./gradlew licensee --no-configuration-cache
- name: 'Analyse'
run: ./gradlew detekt ktlintCheck lint -x lintRelease ${{ env.SCAN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: 'Analyses'
path: |
**/build/reports/detekt
- name: 'Unit tests'
run: ./gradlew :selekt-android:testDebugUnitTest :selekt-java:test :koverHtmlReport -x integrationTest ${{ env.SCAN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: 'Unit test and coverage reports'
path: |
build/reports/kover/html
selekt-android/build/reports/tests/testDebugUnitTest
selekt-java/build/reports/tests/test
- name: 'Build Selekt'
run: |
./gradlew assembleRelease ${{ env.SCAN }}
- name: 'Verify coverage'
run:
./gradlew :koverVerify -x integrationTest
- name: 'Build others'
run: |
./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble dokkaHtml
- name: 'Tear down'
if: always()
run: |
./gradlew --stop