forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 2.39 KB
/
android-unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Android Unit Tests
on:
workflow_dispatch: {}
push:
branches: [main]
paths:
- .github/workflows/android-unit-tests.yml
- apps/expo-go/android/**
- fastlane/**
- packages/**/android/**
- tools/**
- yarn.lock
- '!packages/@expo/cli/**'
pull_request:
paths:
- .github/workflows/android-unit-tests.yml
- apps/expo-go/android/**
- fastlane/**
- packages/**/android/**
- tools/**
- yarn.lock
- '!packages/@expo/cli/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-22.04
timeout-minutes: 100
env:
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1024m
steps:
- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: 👀 Check out repository
uses: actions/checkout@v4
with:
submodules: true
- name: 🧹 Cleanup GitHub Linux runner disk space
uses: ./.github/actions/cleanup-linux-disk-space
- name: 🔨 Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
yarn-tools: 'true'
react-native-gradle-downloads: 'true'
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: 🧶 Install node modules in root dir
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: 💅 Run Spotless lint check
working-directory: apps/expo-go/android
run: ./gradlew spotlessCheck || { echo '::error Spotless lint failed. Run `./gradlew spotlessApply` from `apps/expo-go/android` to automatically fix formatting.' && exit 1; }
- name: 🎸 Run native Android unit tests
if: always()
timeout-minutes: 30
run: expotools native-unit-tests --platform android
- name: 💾 Save test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: packages/**/build/test-results/**/*xml