build: Added run matrix #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Appium Tests | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
api-level: [21, 28, 29, 34] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
working-directory: ./tests | |
run: | | |
npm install -g appium | |
appium driver install uiautomator2 | |
npm install | |
- name: Start Appium server | |
run: appium --allow-insecure=adb_shell & | |
- name: Run emulator and tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
script: ./gradlew assembleDebug && cd tests && npm run test | |
- name: Upload artifacts | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: | | |
tests/failures | |
!tests/failures/sources/.gitignore | |
!tests/failures/screenshots/.gitignore |