-
Notifications
You must be signed in to change notification settings - Fork 7.5k
128 lines (116 loc) · 4.14 KB
/
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
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
119
120
121
122
123
124
125
126
127
128
# This file is used to run the runtime tests for the Arduino core for ESP32.
# The tests are run on the hardware, Wokwi and QEMU emulators.
# The QEMU tests are disabled for now as they are redundant with most of the Wokwi tests.
# As the Wokwi tests require access to secrets, they are run in a separate workflow.
# We need to ensure that the artifacts from previous tests in the chain are propagated for publishing the results.
# This is the current trigger sequence for the tests:
# tests.yml -> tests_wokwi.yml -> tests_results.yml
# ⌙> tests_build.yml
# ⌙> tests_hw.yml
# ⌙> tests_qemu.yml
name: Runtime Tests
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, closed, synchronize, labeled, unlabeled]
paths:
- '.github/workflows/tests*'
- '.github/scripts/*.sh'
- '!.github/scripts/check-cmakelists.sh'
- '!.github/scripts/find_*'
- '!.github/scripts/on-*.sh'
- '!.github/scripts/set_push_chunks.sh'
- '!.github/scripts/update-version.sh'
- '!.github/scripts/upload_py_tools.sh'
- 'tests/**'
- 'cores/**'
- 'libraries/**'
- '!libraries/**.md'
- '!libraries/**.txt'
- '!libraries/**.properties'
- 'package/**'
schedule:
- cron: '0 2 * * *'
concurrency:
group: tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
push-event-file:
name: Push event file
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: event_file
path: ${{ github.event_path }}
gen-matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
build-types: ${{ steps.set-matrix.outputs.build-types }}
hw-types: ${{ steps.set-matrix.outputs.hw-types }}
wokwi-types: ${{ steps.set-matrix.outputs.wokwi-types }}
qemu-types: ${{ steps.set-matrix.outputs.qemu-types }}
steps:
- name: Set matrix
id: set-matrix
run: |
build_types='["validation"'
hw_types='["validation"'
wokwi_types='["validation"'
qemu_types='["validation"'
is_pr=${{ github.event.pull_request.number != null }}
is_performance_enabled=${{ contains(github.event.pull_request.labels.*.name, 'perf_test') }}
if [[ $is_pr != 'true' ]] || [[ $is_performance_enabled == 'true' ]]; then
build_types+=',"performance"'
hw_types+=',"performance"'
#wokwi_types+=',"performance"'
#qemu_types+=',"performance"'
fi
echo "build-types=$build_types]" >> $GITHUB_OUTPUT
echo "hw-types=$hw_types]" >> $GITHUB_OUTPUT
echo "wokwi-types=$wokwi_types]" >> $GITHUB_OUTPUT
echo "qemu-types=$qemu_types]" >> $GITHUB_OUTPUT
call-build-tests:
name: Build
uses: ./.github/workflows/tests_build.yml
needs: gen-matrix
strategy:
matrix:
type: ${{ fromJson(needs.gen-matrix.outputs.build-types) }}
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
with:
type: ${{ matrix.type }}
chip: ${{ matrix.chip }}
call-hardware-tests:
name: Hardware
uses: ./.github/workflows/tests_hw.yml
needs: [gen-matrix, call-build-tests]
if: |
github.repository == 'espressif/arduino-esp32' &&
(github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'hil_test'))
strategy:
fail-fast: false
matrix:
type: ${{ fromJson(needs.gen-matrix.outputs.hw-types) }}
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
with:
type: ${{ matrix.type }}
chip: ${{ matrix.chip }}
# This job is disabled for now
call-qemu-tests:
name: QEMU
uses: ./.github/workflows/tests_qemu.yml
needs: [gen-matrix, call-build-tests]
if: false
strategy:
fail-fast: false
matrix:
type: ${{ fromJson(needs.gen-matrix.outputs.qemu-types) }}
chip: ['esp32', 'esp32c3']
with:
type: ${{ matrix.type }}
chip: ${{ matrix.chip }}
# Wokwi tests are run after this workflow as it needs access to secrets