mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
GitHub Actions: Test multiple Android versions
This commit is contained in:
55
.github/workflows/main.yml
vendored
55
.github/workflows/main.yml
vendored
@@ -1,31 +1,50 @@
|
|||||||
name: Build & Test
|
name: Build & Test
|
||||||
|
on: [push, pull_request]
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macOS-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: Check out source code
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Install Java Development Kit 1.8
|
- name: Install Java Development Kit 1.8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
|
|
||||||
- name: Build APK & Run small tests
|
- name: Build APK & Run small tests
|
||||||
run: android/build.sh build
|
run: android/build.sh build
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: debug-apk
|
||||||
|
path: android/build/*apk
|
||||||
|
|
||||||
|
- name: Upload build folder
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: android/uhabits-android/build/
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
|
runs-on: macOS-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
api-level: [26, 27, 28, 29]
|
||||||
|
steps:
|
||||||
|
- name: Check out source code
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Download previous build folder
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: android/uhabits-android/build/
|
||||||
|
|
||||||
- name: Run medium tests
|
- name: Run medium tests
|
||||||
uses: ReactiveCircus/android-emulator-runner@v2.2.0
|
uses: ReactiveCircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: ${{ matrix.api-level }}
|
||||||
script: android/build.sh medium-tests
|
script: android/build.sh medium-tests
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
|
||||||
name: Build
|
|
||||||
path: android/uhabits-android/build/outputs/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user