mirror of https://github.com/iSoron/uhabits.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.7 KiB
78 lines
1.7 KiB
name: Build & Test
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
push:
|
|
paths-ignore:
|
|
- '**.md'
|
|
jobs:
|
|
Build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out source code
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Install Java Development Kit 11
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 11
|
|
|
|
- name: Build Project
|
|
run: ./build.sh build
|
|
|
|
- name: Upload Build Artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: uhabits-android
|
|
path: uhabits-android/build/outputs/
|
|
|
|
AndroidTest:
|
|
needs: Build
|
|
runs-on: macOS-10.15
|
|
timeout-minutes: 60
|
|
strategy:
|
|
matrix:
|
|
api: [
|
|
25,
|
|
27,
|
|
28,
|
|
30,
|
|
31,
|
|
]
|
|
|
|
steps:
|
|
- name: Check out source code
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Download Previously Built APK
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: uhabits-android
|
|
path: uhabits-android/build/outputs/
|
|
|
|
- name: Install Linux utils
|
|
run: |
|
|
brew unlink parallel
|
|
brew install util-linux moreutils coreutils
|
|
echo "/usr/local/opt/util-linux/bin" >> $GITHUB_PATH
|
|
echo "/usr/local/opt/moreutils/bin" >> $GITHUB_PATH
|
|
echo "/usr/local/opt/coreutils/libexec/gnubin" >> $GITHUB_PATH
|
|
|
|
- name: AVD cache
|
|
uses: actions/cache@v3
|
|
id: avd-cache
|
|
with:
|
|
path: |
|
|
~/.android/avd/*
|
|
~/.android/adb*
|
|
key: avd-${{ matrix.api }}
|
|
|
|
- name: Setup AVD
|
|
if: steps.avd-cache.outputs.cache-hit != 'true'
|
|
run: ./build.sh android-setup ${{ matrix.api }}
|
|
|
|
- name: Run Android Tests
|
|
run: ./build.sh android-tests ${{ matrix.api }}
|
|
|