Skip to content

Commit

Permalink
Add Android lint & test to GitHub CI
Browse files Browse the repository at this point in the history
This commit implements the Android Lint and Tests into the pipeline to
check if everything is ok at least with the written unit tests.

Closes #6678
  • Loading branch information
murilopereirame committed Mar 19, 2024
1 parent 7fa3626 commit 08ecd3c
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/kotlin-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Kotlin CI

on:
push:
branches-ignore:
- master
paths: [ "app-android/**" ]

jobs:
test-kotlin:
runs-on: ubuntu-latest
env:
java-version: 21
java-distribution: 'temurin'
node-version: 20.11.1
TZ: "Europe/Berlin"
permissions:
actions: none
checks: none
contents: read
deployments: none
id-token: none
issues: none
discussions: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Get better-sqlite3 cached location
run: |
echo "better_sqlite3_path=$(node buildSrc/getNativeCacheLocation.js better-sqlite3)" >> $GITHUB_ENV
- name: Try to use cached better-sqlite3
uses: actions/cache@v3
with:
path: ${{ env.better_sqlite3_path }}
key: ${{ env.better_sqlite3_path }}
- name: Install packages
run: npm ci && npm run build-packages
- name: Build WebApp
run: node webapp
- name: Set up JDK ${{ env.java-version }}
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #4.2.1
with:
java-version: ${{ env.java-version }}
distribution: ${{ env.java-distribution }}
- name: Setup Android SDK
uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f #3.2.0
- name: Lint
working-directory: ./app-android
run: ./gradlew lint --quiet
- name: Test
working-directory: ./app-android
run: ./gradlew test

0 comments on commit 08ecd3c

Please sign in to comment.