-
Notifications
You must be signed in to change notification settings - Fork 22
112 lines (97 loc) · 3.23 KB
/
build-release-test.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
name: CanMV Build and Release and Test
on:
push:
tags: [ "v*" ]
branches: [ "main", "test/*" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Prepare Environment
run: |
wget https://github.com/kendryte/kendryte-gnu-toolchain/releases/download/v8.2.0-20190409/kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
sudo tar -Jxf kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz -C /opt
rm -f kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
git fetch --unshallow
git submodule update --init --recursive
cd projects && mkdir build
cp README.md build
- name: Build Projects
run: |
projects=("canmv_k1" "canmv_dock" "canmv_k210" "canmv_makerobo" "canmv_dnk210")
for proj in ${projects[@]};do
cd projects/${proj}
echo "-------------------"
echo "build project ${proj}-standard"
echo "-------------------"
python project.py distclean
python project.py build --config_file "config_standard.mk"
mv build/canmv.bin ${{ github.workspace }}/projects/build/${proj}_standard.bin
echo "-------------------"
echo "build project ${proj}-lite"
echo "-------------------"
python project.py distclean
python project.py build --config_file "config_lite.mk"
mv build/canmv.bin ${{ github.workspace }}/projects/build/${proj}_lite.bin
cd -
done
- uses: actions/upload-artifact@v3
with:
name: "canmv-${{ github.sha }}"
path: ${{ github.workspace }}/projects/build/**
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: ./release
name: "canmv-${{ github.sha }}"
- uses: ncipollo/release-action@v1
with:
artifacts: "release/**.bin"
token: ${{ secrets.GITHUB_TOKEN }}
test:
if: endsWith(github.ref, 'main')
runs-on: self-hosted
needs: build
defaults:
run:
shell: bash
env:
SERIAL_DEV: /dev/ttyACM1
steps:
- name: Check Board
run: |
ls ${{ env.SERIAL_DEV }}
if [ $? -ne 0 ]; then
echo "Runner have no board connected."
exit -1
fi
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: ./build
name: "canmv-${{ github.sha }}"
- name: Burn Test Firmware
run: |
python3 tools/flash/kflash_py/kflash.py -p ${{ env.SERIAL_DEV }} -b 1500000 build/canmv_k1_standard.bin
- name: Run Tests
run: |
cd tools/tests
python3 run-tests.py --target k210 --device ${{ env.SERIAL_DEV }} --baudrate 115200
cd -
- uses: actions/upload-artifact@v3
with:
name: "canmv-test-results-${{ github.sha }}"
path: tools/tests/results