-
Notifications
You must be signed in to change notification settings - Fork 5
150 lines (135 loc) · 3.96 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: gen_pack
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
release:
types: [published]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Ubuntu deps
run: |
sudo apt-get update
sudo apt-get install \
shellcheck
- uses: ammaraskar/gcc-problem-matcher@master
- name: Run ShellCheck
run: |
shellcheck -s bash -f gcc gen-pack lib/*
cov:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Ubuntu deps
run: |
sudo apt-get update
sudo apt-get install \
dos2unix \
kcov
- name: Run kcov
run: |
./test/run_cov.sh
- name: Upload Report to Codecov
uses: Wandalen/wretry.action@master
with:
action: codecov/codecov-action@v4
with: |
token: ${{ secrets.CODECOV_TOKEN }}
files: test/cov/all/kcov-merged/cov.xml
name: Unittests
fail_ci_if_error: true
attempt_limit: 3
attempt_delay: 5000
- name: Publish code coverage to CodeClimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/test/cov/all/kcov-merged/cov.xml:cobertura
prefix: ${{github.workspace}}//
debug: true
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
os: [ macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, windows-2022 ]
include:
- os: macos-13
target: darwin-amd64
archiveext: tar.gz
unarcmd: tar -xzf
- os: macos-14
target: darwin-arm64
archiveext: tar.gz
unarcmd: tar -xzf
- os: ubuntu-20.04
target: linux-amd64
archiveext: tar.gz
unarcmd: tar -xzf
- os: ubuntu-22.04
target: linux-amd64
archiveext: tar.gz
unarcmd: tar -xzf
- os: windows-2022
target: windows-amd64
archiveext: zip
unarcmd: 7z x
env:
CMSIS_PACK_ROOT: ${{ github.workspace }}/.packs/
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ubuntu deps
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install \
dos2unix \
libxml2-utils
- name: Install MacOS deps
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install \
bash \
coreutils \
dos2unix \
gnu-tar \
grep
- name: Install CMSIS-Toolbox
shell: bash
run: |
curl -L https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases/download/2.3.0/cmsis-toolbox-${{ matrix.target }}.${{ matrix.archiveext }} -o cmsis-toolbox-${{ matrix.target }}.${{ matrix.archiveext }}
${{ matrix.unarcmd }} cmsis-toolbox-${{ matrix.target }}.${{ matrix.archiveext }}
echo "$(pwd)/cmsis-toolbox-${{ matrix.target }}/bin" >> $GITHUB_PATH
- name: Install pack ARM.CMSIS
shell: bash
run: |
cpackget init https://www.keil.com/pack/index.pidx
cpackget add ARM.CMSIS
- name: Run unit tests
shell: bash
env:
LANG: en_GB.UTF-8
LC_ALL: en_GB.UTF-8
TMPDIR: ${{ github.workspace }}/../../tmp
run: |
mkdir -p ${TMPDIR}
./test/run_all.sh