-
-
Notifications
You must be signed in to change notification settings - Fork 82
129 lines (105 loc) · 3.89 KB
/
build.yaml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build Repository
on:
push:
branches: [ "v*" ]
pull_request:
branches: [ "**" ]
jobs:
build:
name: Build with JDK ${{ matrix.jdk }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
jdk: [ 11, 17 ]
steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Restore local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: tinylog3-jvm-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
tinylog3-jvm-${{ runner.os }}-maven-
- name: Download and install JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.jdk }}
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
- name: Upload code coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
android-tests:
name: Tests on Android (API level ${{ matrix.api-level }})
runs-on: macos-13
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
api-level: [ 26, 33 ]
steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Restore local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: tinylog3-android-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
tinylog3-android-${{ runner.os }}-maven-
- name: Restore Gradle caches and wrapper
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: tinylog3-android-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
tinylog3-android-${{ runner.os }}-gradle-
- name: Restore Android virtual device
id: avd-cache
uses: actions/cache@v4
with:
path: |
~/.android/avd/*
~/.android/adb*
key: tinylog3-${{ runner.os }}-avd${{ matrix.api-level }}
- name: Download and install JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Install core and impl artifacts via Maven
run: mvn --batch-mode --update-snapshots --also-make --projects :tinylog-core,:tinylog-impl install -DskipTests
- name: Set up Android virtual device if not cached
uses: reactivecircus/android-emulator-runner@v2
if: steps.avd-cache.outputs.cache-hit != 'true'
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run instrumented tests on Android virtual device
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: ./tinylog-android-tests
script: chmod +x ./gradlew && ./gradlew createDebugCoverageReport spotbugsDebug checkstyle
- name: Upload code coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}