-
Notifications
You must be signed in to change notification settings - Fork 52
118 lines (100 loc) · 4.2 KB
/
build.yml
File metadata and controls
118 lines (100 loc) · 4.2 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: build
on:
workflow_dispatch: {}
push:
branches:
- jbion/github-build
jobs:
test-standard:
strategy:
fail-fast: false # So that all jobs run to completion even when one fails
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Standard tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Setup Amper caches
uses: ./.github/actions/setup-amper
- name: Setup test caches
uses: ./.github/actions/test-caches
- name: Create local.properties with empty credentials
shell: bash
run: |
echo "space.username=" >> local.properties
echo "space.password=" >> local.properties
- name: Run regular tests
run: ./amper test --exclude-module=amper-mobile-test --exclude-module=amper-cli-test
- name: Run CLI tests
run: ./amper test --include-module=amper-cli-test
- name: Report Amper logs
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: build-logs-${{ runner.os }}
path: build/logs/**
archive: true
# In amper-cli-test, we start child Amper CLI processes we publish their logs as attachments of JUnit reports
- name: Report JUnit attachments
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: junit-attachments-${{ runner.os }}
path: build/reports/*/jvm/junit-jupiter
archive: true
retention-days: 15
- name: Report test results
uses: ./.github/actions/report-tests
if: ${{ !cancelled() }} # run this step even if the previous step failed
test-mobile:
strategy:
fail-fast: false # So that all jobs run to completion even when one fails
matrix:
include:
- description: Android examples
testArgs: "--include-classes=RunAndroidExamplesOnEmulatorsTestsStandalone"
os: ubuntu-latest
- description: iOS examples
testArgs: "--include-classes=RuniOSExamplesOnEmulatorsTestsStandalone"
os: macos-latest
# FIXME external projects require git credentials - maybe they should just be in our examples...
# - description: Android external projects
# testArgs: "--include-classes=RunAndroidExternalProjectsStandalone"
# os: ubuntu-latest
# - description: iOS external projects
# testArgs: "--include-classes=RuniOSExternalProjectsStandalone"
# os: macos-latest
name: Mobile tests (${{ matrix.description }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Setup Amper caches
uses: ./.github/actions/setup-amper
- name: Setup test caches
uses: ./.github/actions/test-caches
- name: Create local.properties with empty credentials
shell: bash
run: |
echo "space.username=" >> local.properties
echo "space.password=" >> local.properties
- name: Enable KVM group perms
if: ${{ runner.os == 'Linux' }} # needed for Android emulator
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
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 mobile tests
run: ./amper test -m amper-mobile-test ${{ matrix.testArgs }}
- name: Report Amper logs
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # run this step even if the previous step failed
with:
name: build-logs-mobile-${{ matrix.description }}
path: build/logs/**
archive: true
- name: Report test results
uses: ./.github/actions/report-tests
if: ${{ !cancelled() }} # run this step even if previous step failed