Set up CI with GitHub Actions

This commit is contained in:
Danilo Bargen
2022-01-30 22:24:16 +01:00
parent a53659f835
commit f73881a69a
2 changed files with 41 additions and 0 deletions

7
.github/workflows/apikeys-ci.xml vendored Normal file
View File

@@ -0,0 +1,7 @@
<resources>
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">ci</string>
<string name="mapbox_key" translatable="false">ci</string>
<string name="goingelectric_key" translatable="false">ci</string>
<string name="chargeprice_key" translatable="false">ci</string>
<string name="openchargemap_key" translatable="false">ci</string>
</resources>

34
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
on:
pull_request:
push:
branches:
- master
name: Tests
jobs:
test:
name: Build and Test (${{ matrix.buildvariant }})
runs-on: ubuntu-latest
strategy:
matrix:
buildvariant: [Foss, Google]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Java environment
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
cache: 'gradle'
- name: Copy apikeys.xml
run : cp .github/workflows/apikeys-ci.xml app/src/main/res/values/apikeys.xml
- name: Build app
run: ./gradlew assemble${{ matrix.buildvariant }}Debug --no-daemon
- name: Run unit tests
run: ./gradlew test${{ matrix.buildvariant }}DebugUnitTest --no-daemon