Skip to content

Commit c06b53e

Browse files
committed
Updates to repo workflows
1 parent 25664fb commit c06b53e

File tree

4 files changed

+200
-181
lines changed

4 files changed

+200
-181
lines changed

.github/workflows/android_ci.yml

Lines changed: 0 additions & 133 deletions
This file was deleted.

.github/workflows/ci_android.yaml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: ci_android
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
types:
7+
- opened
8+
- reopened
9+
- synchronize
10+
push:
11+
branches:
12+
- main
13+
14+
permissions:
15+
pull-requests: write
16+
contents: read
17+
18+
jobs:
19+
lint:
20+
runs-on: ubuntu-latest
21+
name: Run Ktlint and Detekt
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Prepare App
29+
uses: ./.github/composite/prepareApp
30+
31+
- name: Run Ktlint
32+
run: ./gradlew lintKotlin
33+
34+
- name: Run Detekt
35+
run: ./gradlew detekt
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
name: Run Tests
40+
steps:
41+
- name: Checkout Repository
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: true
45+
46+
- name: Prepare App
47+
uses: ./.github/composite/prepareApp
48+
49+
- name: Run Ktlint
50+
run: ./gradlew test
51+
52+
collect_coverage:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout Repository
56+
uses: actions/checkout@v4
57+
with:
58+
submodules: true
59+
60+
- name: Set up JDK
61+
uses: actions/setup-java@v1
62+
with:
63+
java-version: 17
64+
65+
- name: Grant Execute Permission for Gradle Wrapper
66+
run: chmod +x gradlew
67+
68+
- name: Get Coverage
69+
run: ./gradlew koverReport
70+
71+
- name: Run File-wise Coverage Parser Script
72+
run: python3 scripts/coverage_parser.py
73+
74+
build:
75+
runs-on: ubuntu-latest
76+
name: build app
77+
steps:
78+
- name: Checkout Repository
79+
uses: actions/checkout@v4
80+
with:
81+
submodules: true
82+
83+
- name: Prepare App
84+
uses: ./.github/composite/prepareApp
85+
86+
- name: Build App
87+
run: ./gradlew assembleDebug
88+
89+
- name: Upload Debug APK
90+
uses: actions/upload-artifact@v4
91+
if: success()
92+
with:
93+
name: latest-apk
94+
path: "app/build/outputs/apk/core/debug/app-core-debug.apk"
95+
96+
instrumentation_test:
97+
runs-on: ubuntu-latest
98+
name: Run Android Instrumentation Tests
99+
timeout-minutes: 50
100+
steps:
101+
- name: Checkout Repository
102+
uses: actions/checkout@v4
103+
with:
104+
submodules: true
105+
106+
- name: Prepare App
107+
uses: ./.github/composite/prepareApp
108+
109+
- name: Enable KVM Group Permissions
110+
run: |
111+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
112+
sudo udevadm control --reload-rules
113+
sudo udevadm trigger --name-match=kvm
114+
115+
- name: Run UI Tests on Emulator
116+
uses: reactivecircus/android-emulator-runner@v2
117+
with:
118+
api-level: 29
119+
target: google_apis
120+
arch: x86_64
121+
profile: Nexus 6
122+
ram-size: 2048M
123+
heap-size: 512M
124+
disk-size: 6000M
125+
emulator-options: "-no-window -no-audio -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect -no-snapshot -wipe-data -accel on"
126+
disable-animations: true
127+
force-avd-creation: false
128+
script: |
129+
adb wait-for-device
130+
sleep 30
131+
adb shell input keyevent 82
132+
adb shell settings put global window_animation_scale 0.0
133+
adb shell settings put global transition_animation_scale 0.0
134+
adb shell settings put global animator_duration_scale 0.0
135+
adb shell pm list packages >/dev/null
136+
sleep 10
137+
adb shell getprop sys.boot_completed
138+
./gradlew connectedConjugateDebugAndroidTest --stacktrace
139+
./gradlew connectedKeyboardsDebugAndroidTest --stacktrace

.github/workflows/pr_ci_license_header_check.yaml renamed to .github/workflows/ci_license_header_check.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
name: pr_ci_license_header_check
1+
name: ci_license_header_check
22
on:
33
pull_request:
44
branches:
55
- main
6-
types: [opened, reopened, synchronize]
6+
types:
7+
- opened
8+
- reopened
9+
- synchronize
10+
push:
11+
branches:
12+
- main
713

814
jobs:
915
license_header_check:
Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,57 @@
11
name: pr_maintainer_checklist
22
on:
3-
pull_request_target:
4-
branches:
5-
- main
6-
types:
7-
- opened
3+
pull_request_target:
4+
branches:
5+
- main
6+
types:
7+
- opened
88

99
jobs:
10-
add_pr_checklist:
11-
runs-on: ubuntu-latest
12-
name: Add PR Maintainer Checklist
13-
permissions:
14-
pull-requests: write
15-
steps:
16-
- name: Thank You Message
17-
uses: thollander/actions-comment-pull-request@v2
18-
with:
19-
message: |
20-
## Thank you for the pull request! 💙
21-
22-
The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining! We'd suggest that you use the [Element](https://element.io/) client as well as [Element X](https://element.io/app) for a mobile app, and definitely join the `General` and `Android` rooms once you're in. Also consider attending our [bi-weekly Saturday dev syncs](https://etherpad.wikimedia.org/p/scribe-dev-sync). It'd be great to meet you 😊
23-
24-
> [!NOTE]
25-
> Scribe uses [Conventional Comments](https://conventionalcomments.org/) in reviews to make sure that communication is as clear as possible.
26-
27-
- name: Add Checklist
28-
uses: thollander/actions-comment-pull-request@v2
29-
with:
30-
message: |
31-
## Maintainer Checklist
32-
33-
The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
34-
35-
- [ ] Tests for changes have been written and the unit test, linting and formatting workflows within the [PR checks](https://github.com/scribe-org/Scribe-Android/pull/${{ github.event.pull_request.number }}/checks) do not indicate new errors in the files changed
36-
- Tests may need to be reran as they're at times not deterministic
37-
38-
- [ ] The [CHANGELOG](https://github.com/scribe-org/Scribe-Android/blob/main/CHANGELOG.md) has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)
39-
40-
- name: First PR Contributor Email Check
41-
id: first_interaction
42-
uses: actions/first-interaction@v1
43-
with:
44-
repo-token: ${{ secrets.GITHUB_TOKEN }}
45-
pr-message: |
46-
## First PR Commit Check
47-
48-
- [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
49-
- The contributor's name and icon in remote commits should be the same as what appears in the PR
50-
- If there's a mismatch, the contributor needs to make sure that the [email they use for GitHub](https://github.com/settings/emails) matches what they have for `git config user.email` in their local Scribe-Android repo (can be set with `git config --global user.email "GITHUB_EMAIL"`)
10+
add_pr_checklist:
11+
runs-on: ubuntu-latest
12+
name: Add PR Maintainer Checklist
13+
permissions:
14+
pull-requests: write
15+
steps:
16+
- name: Thank You Message
17+
uses: thollander/actions-comment-pull-request@v2
18+
with:
19+
message: |
20+
## Thank you for the pull request! 💙🩵
21+
22+
The Scribe-Android team will do our best to address your contribution as soon as we can. The following are some important points:
23+
- Those interested in developing their skills and expanding their role in the community should read the [mentorship and growth section of the contribution guide](https://github.com/scribe-org/Scribe-Android/blob/main/CONTRIBUTING.md#mentorship-and-growth)
24+
- If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining!
25+
- We'd suggest that you use the [Element](https://element.io/) client as well as [Element X](https://element.io/app) for a mobile app
26+
- Join the `General` and `Android` rooms once you're in
27+
- Also consider attending our bi-weekly Saturday developer syncs!
28+
- Details are shared in the `General` room on Matrix each Wednesday before the sync
29+
- It would be great to meet you 😊
30+
31+
> [!NOTE]
32+
> Scribe uses [Conventional Comments](https://conventionalcomments.org/) in reviews to make sure that communication is as clear as possible.
33+
34+
- name: Add Checklist
35+
uses: thollander/actions-comment-pull-request@v2
36+
with:
37+
message: |
38+
## Maintainer Checklist
39+
40+
The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
41+
42+
- [ ] Tests for changes have been written and the unit test, linting and formatting workflows within the [PR checks](https://github.com/scribe-org/Scribe-Android/pull/${{ github.event.pull_request.number }}/checks) do not indicate new errors in the files changed
43+
- Tests may need to be reran as they're at times not deterministic
44+
45+
- [ ] The [CHANGELOG](https://github.com/scribe-org/Scribe-Android/blob/main/CHANGELOG.md) has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)
46+
47+
- name: First PR Contributor Email Check
48+
id: first_interaction
49+
uses: actions/first-interaction@v1
50+
with:
51+
repo-token: ${{ secrets.GITHUB_TOKEN }}
52+
pr-message: |
53+
## First PR Commit Check
54+
55+
- [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
56+
- The contributor's name and icon in remote commits should be the same as what appears in the PR
57+
- If there's a mismatch, the contributor needs to make sure that the [email they use for GitHub](https://github.com/settings/emails) matches what they have for `git config user.email` in their local Scribe-Android repo (can be set with `git config --global user.email "GITHUB_EMAIL"`)

0 commit comments

Comments
 (0)