Skip to content

Commit 9ad38c8

Browse files
committed
feat(linux-target): add example of running tests on linux target
1 parent 764ca0b commit 9ad38c8

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/ci_workflow.yml

+4
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ jobs:
2323
name: Test Project (Hardware)
2424
uses: ./.github/workflows/test_esp_app.yml
2525
needs: build_project
26+
test_project_host_linux:
27+
name: Test Project (Host, linux-target)
28+
uses: ./.github/workflows/test_linux_target.yml
29+
needs: build_project
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Run Test Application (Linux Target on Host)
2+
3+
on:
4+
workflow_call: {}
5+
workflow_dispatch: {}
6+
jobs:
7+
run-target:
8+
name: Run Test App on linux target on host
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
- name: Download files / artifacts from build job
16+
uses: actions/download-artifact@v4
17+
with:
18+
name: test_app_bin_linux
19+
path: test_app/build
20+
- name: Install Python packages for PyTest
21+
env:
22+
PIP_PREFER_BINARY: true
23+
PIP_INDEX_URL: "https://dl.espressif.com/pypi/"
24+
PIP_EXTRA_INDEX_URL: "https://pypi.org/simple"
25+
run: pip install -r test_app/requirements.txt
26+
- name: Run Test App on target
27+
working-directory: test_app
28+
run: |
29+
pytest \
30+
--junit-xml=./test_app_results_linux.xml \
31+
--embedded-services esp,idf \
32+
--target=linux
33+
- name: Upload test results for publish-results job
34+
uses: actions/upload-artifact@v4
35+
if: always()
36+
with:
37+
name: test_app_results_linux
38+
path: test_app/*.xml
39+
publish-results:
40+
name: Publish Test App results
41+
needs: run-target
42+
runs-on: ubuntu-20.04
43+
if: always() # (run even if the previous steps have failed)
44+
steps:
45+
- name: Download Test results
46+
uses: actions/download-artifact@v4
47+
with:
48+
path: test_results
49+
- name: Publish Test Results
50+
uses: EnricoMi/publish-unit-test-result-action@v2
51+
with:
52+
files: test_results/**/*.xml

0 commit comments

Comments
 (0)