Repository navigation
84 lines (81 loc) · 2.63 KB
/
Copy pathtest.yml
File metadata and controls
84 lines (81 loc) · 2.63 KB
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
77
78
79
80
81
82
83
84
# Reusable test suite for pull request orchestration.
# It uploads a test summary artifact for inspection from the workflow run.
#
# This is the main automated test gate.
name: Test
on:
workflow_call:
inputs:
should-run:
description: Whether the pull request contains code or build changes.
required: true
type: boolean
source-sha:
description: Immutable revision being checked.
required: true
type: string
permissions:
contents: read
jobs:
test:
name: Test
if: ${{ inputs.should-run }}
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 1
ref: ${{ inputs.source-sha }}
- name: Validate CI scripts
run: |
set -euo pipefail
bash scripts/ci-has-code-changes.sh --self-test
bash scripts/ci-should-run-gif-validation.sh --self-test
- name: Set up JDK 17
uses: actions/setup-java@v6.0.1
with:
java-version: 17
distribution: 'zulu'
cache: gradle
- name: Cache Gradle packages
uses: actions/cache@v6.1.0
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test
run: |
set -euo pipefail
./gradlew sampleTest
cd lib
./gradlew recorderTest
- name: Enable KVM for Android emulator
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 recorder Android instrumentation tests
uses: reactivecircus/android-emulator-runner@v2.38.0
with:
api-level: 35
target: google_apis
arch: x86_64
profile: Nexus 6
emulator-options: -no-window -no-audio -gpu swiftshader_indirect -no-snapshot
script: |
cd lib && ./gradlew recorderInstrumentationTest --no-daemon --stacktrace
- name: Upload Gradle test reports
if: ${{ always() && inputs.should-run }}
uses: actions/upload-artifact@v7.0.1
with:
name: gradle-test-reports
if-no-files-found: warn
path: |
**/build/reports/tests/**
**/build/test-results/**
**/build/reports/androidTests/**
**/build/outputs/androidTest-results/**