-
Notifications
You must be signed in to change notification settings - Fork 26
102 lines (87 loc) · 3.13 KB
/
pre_release.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: PRE_RELEASE
on:
pull_request:
types: [ labeled ]
jobs:
build:
if: ${{ github.event.label.name == 'pre release' }}
runs-on: ubuntu-latest
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/[email protected]
with:
android: false # Don't remove Android tools
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
dotnet: true # rm -rf /usr/share/dotnet
haskell: true # rm -rf /opt/ghc...
swap-storage: true # rm -f /mnt/swapfile (4GiB)
docker-images: false # Takes 16s, enable if needed in the future
large-packages: false # includes google-cloud-sdk and it's slow
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- uses: actions/checkout@v4
with:
submodules: true
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Before script
run: |
chmod +x gradlew
chmod +x gradle/publishAllToMavenLocal.sh
chmod +x gradle/preRelease.sh
- name: Run Gradle command
run: |
bash ./gradlew spotlessCheck
bash ./gradle/publishAllToMavenLocal.sh
bash ./gradle/preRelease.sh
- name: Run demo ui tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
target: default
ram-size: 4096M
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
working-directory: ./demo
script: ./gradlew :app:connectedAndroidTest --stacktrace
- name: Run sdk unit tests
run: |
bash ./gradlew jacocoTestReport --stacktrace
bash ./gradlew :jacocoAllReport
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube
continue-on-error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./build/reports/jacoco/jacocoAllReport/jacocoAllReport.xml