mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
name: 'apps/automated/android'
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'ci/**'
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test-android:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 23.5.0
|
|
|
|
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
|
uses: nrwl/nx-set-shas@v4
|
|
with:
|
|
main-branch-name: 'main'
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '21'
|
|
|
|
- name: Install Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3'
|
|
|
|
- name: Install NativeScript
|
|
run: |
|
|
python3 -m pip install --upgrade pip six
|
|
npm i -g nativescript --ignore-scripts
|
|
ns usage-reporting disable
|
|
ns error-reporting disable
|
|
|
|
- name: Setup
|
|
run: npm run setup
|
|
|
|
- name: Unit Tests
|
|
run: npx nx run-many --target=test --configuration=ci --projects=core
|
|
|
|
- name: Enable KVM group perms
|
|
run: |
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --name-match=kvm
|
|
|
|
- name: Run tests on Android Emulator
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 34
|
|
arch: x86_64
|
|
script: npx nx test apps-automated -c=android
|