-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.67 KB
/
build-flash-and-run-simple.yml
File metadata and controls
90 lines (78 loc) · 2.67 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
name: Simple pipeline to build firmware, flash DUT, and run tests
on: [push]
env:
LAGER_GATEWAY: 113
concurrency:
group: dut
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build Project
uses: docker://lagerdata/devenv-cortexm-minimal
with:
entrypoint: /usr/local/bin/lager
args: exec build
- name: Upload the test hexfile
uses: actions/upload-artifact@v2
with:
name: test_hexfile
path: _build/unit-tests/test-suites/test-example/test-example.hex
- name: Upload the app hexfile
uses: actions/upload-artifact@v2
with:
name: app_hexfile
path: _build/app/app.hex
- name: Upload led python test script
uses: actions/upload-artifact@v2
with:
name: led_test_script
path: system-tests/led_test/main.py
connect:
runs-on: ubuntu-latest
steps:
- name: Connect to gateway
uses: docker://lagerdata/lager-cli
env:
LAGER_TOKEN_ID: ${{ secrets.LAGER_TOKEN_ID }}
LAGER_TOKEN_SECRET: ${{ secrets.LAGER_TOKEN_SECRET }} #This is setup inside GitHub see https://docs.lagerdata.com/ci/github_actions.html
with:
entrypoint: /usr/local/bin/lager
args: connect --device nrf52 --interface ftdi --transport swd --speed 4000 --force
run_tests: #Only proceed to this step if the build and connect jobs succeeded
runs-on: ubuntu-latest
needs: [build, connect]
steps:
- name: Download the test hexfile
uses: actions/download-artifact@v2
with:
name: test_hexfile
- name: Download the app hexfile
uses: actions/download-artifact@v2
with:
name: app_hexfile
- name: Download led test python script
uses: actions/download-artifact@v2
with:
name: led_test_script
- name: Run a unit test
uses: docker://lagerdata/lager-cli
env:
LAGER_TOKEN_ID: ${{ secrets.LAGER_TOKEN_ID }}
LAGER_TOKEN_SECRET: ${{ secrets.LAGER_TOKEN_SECRET }}
with:
entrypoint: /usr/local/bin/lager
args: testrun --serial-device /dev/ttyACM0 --hexfile /github/workspace/test-example.hex
- name: Run LED System Test
uses: docker://lagerdata/lager-cli
env:
LAGER_TOKEN_ID: ${{ secrets.LAGER_TOKEN_ID }}
LAGER_TOKEN_SECRET: ${{ secrets.LAGER_TOKEN_SECRET }}
with:
entrypoint: /usr/local/bin/lager
args: python /github/workspace