-
-
Notifications
You must be signed in to change notification settings - Fork 77
56 lines (45 loc) · 1.76 KB
/
screenshots.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
name: Take screenshots and create PR
on:
workflow_dispatch:
jobs:
take-screenshots-and-create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
cache: 'gradle'
- name: Install OptiPNG
run: sudo apt install optipng
- name: Setup Python dependencies for the screenshot server
run: python -m pip install flask
- name: Start screenshot server
run: python ./app/src/androidTest/kotlin/org/stypox/dicio/screenshot/screenshot_server.py &
- name: Enable KVM
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
- name: Run Android instrumented tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: default
arch: x86_64
profile: Nexus 5X
script: ./gradlew connectedCheck -P android.testInstrumentationRunnerArguments.class=org.stypox.dicio.screenshot.ScreenshotTakerTest
- name: Print git status
run: git status
- name: Optimize PNGs
run: optipng fastlane/metadata/android/**/images/phoneScreenshots/*.png
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: gh-action-update-screenshots
title: "Update screenshots"
body: "Automated changes by CI workflow \"Take screenshots and create Pull Request\""
commit-message: "Update screenshots"