Skip to content

Commit fa903fe

Browse files
committed
chore: add CI workflow to gate pushes to main
1 parent 30bdfa5 commit fa903fe

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ci-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
checks:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 45
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: "17"
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
28+
- name: Write google-services.json
29+
env:
30+
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
31+
run: |
32+
if [ -n "$GOOGLE_SERVICES_JSON" ]; then
33+
printf '%s' "$GOOGLE_SERVICES_JSON" > app/google-services.json
34+
else
35+
cp app/google-services.json.example app/google-services.json
36+
fi
37+
38+
- name: ktlint
39+
run: ./gradlew ktlintCheck --no-daemon
40+
41+
- name: Unit tests
42+
run: ./gradlew test --no-daemon
43+
44+
- name: Lint (app)
45+
run: ./gradlew :app:lintDebug --no-daemon
46+
47+
- name: Assemble debug
48+
run: ./gradlew :app:assembleDebug --no-daemon

0 commit comments

Comments
 (0)