-
Notifications
You must be signed in to change notification settings - Fork 20
104 lines (87 loc) · 3.4 KB
/
ci-gradle.yml
File metadata and controls
104 lines (87 loc) · 3.4 KB
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
name: CI
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
DEPOT_RUNNER: depot-ubuntu-24.04-8
jobs:
environment:
runs-on: ubuntu-latest
outputs:
where: ${{ steps.choose.outputs.where }}
steps:
- id: choose
run: |
if [ ${GITHUB_ACTOR} != 'dependabot[bot]' ]; then
echo "where=${DEPOT_RUNNER}" >> $GITHUB_OUTPUT
else
echo "where=ubuntu-latest" >> $GITHUB_OUTPUT
fi
gradle:
needs: environment
runs-on: ${{ needs.environment.outputs.where }}
timeout-minutes: 60
strategy:
matrix:
gradle-task: ['build', 'bundleReleaseExampleApp']
fail-fast: false
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
if: ${{ needs.environment.outputs.where == 'ubuntu-latest' }}
with:
tool-cache: false
android: false
- name: Checkout Branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'adopt'
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.m2/repository/org/robolectric
key: robolectric-${{ hashFiles('.github/fetch-robolectric-dependencies.sh') }}
restore-keys: |
robolectric-
- name: Fetch Robolectric dependencies
run: /bin/sh .github/fetch-robolectric-dependencies.sh
- name: Gradle (embrace-gradle-plugin-integration-tests:test)
if: ${{ matrix.gradle-task == 'test' }}
run: ./gradlew embrace-gradle-plugin-integration-tests:test --stacktrace
- name: Gradle (build -x embrace-gradle-plugin-integration-tests:test)
if: ${{ matrix.gradle-task == 'build' }}
run: ./gradlew build embrace-microbenchmark:assembleAndroidTest -x embrace-gradle-plugin-integration-tests:test --stacktrace
- name: Gradle (examples/ExampleApp/ bundleRelease)
if: ${{ matrix.gradle-task == 'bundleReleaseExampleApp' }}
working-directory: examples/ExampleApp
run: ./gradlew bundleRelease
- name: Archive Test Results
if: ${{ always() && matrix.gradle-task != 'bundleReleaseExampleApp' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: test-results-${{ matrix.gradle-task }}
path: '**/build/reports/tests/**'
- name: Run Kover Code Coverage
if: ${{ matrix.gradle-task == 'build' }}
run: ./gradlew koverXmlReport
- name: Upload Code Coverage
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
if: ${{ matrix.gradle-task == 'build' }}
with:
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
fail_ci_if_error: true
files: build/reports/kover/reportRelease.xml