-
Notifications
You must be signed in to change notification settings - Fork 19
135 lines (122 loc) · 4.42 KB
/
build-projects.yaml
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
name: Build projects
on:
push:
branches:
- main
pull_request:
jobs:
check-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update submodules recursively
run: |
git submodule update --init --recursive
- name: Check no-OS versions
run: |
git submodule status
lib_version=$(git submodule status | sed -nr 's/.(.*) libraries\/no-OS.*/\1/p')
submodule_version=$(sed -e 's/.*#//' libraries/no-OS.lib)
if [[ "${lib_version}" != "${submodule_version}" ]]; then
echo "ERROR: no-OS version in lib (${lib_version}) does not match submodule (${submodule_version})"
exit 1
fi
echo "SUCCESS: no-OS version in lib and submodule match (${lib_version})"
- name: Check Precision Converters Library versions
run: |
git submodule status
lib_version=$(git submodule status | sed -nr 's/.(.*) libraries\/precision-converters-library.*/\1/p')
submodule_version=$(sed -e 's/.*#//' libraries/precision-converters-library.lib)
if [[ "${lib_version}" != "${submodule_version}" ]]; then
echo "ERROR: PCL version in lib (${lib_version}) does not match submodule (${submodule_version})"
exit 1
fi
echo "SUCCESS: PCL version in lib and submodule match (${lib_version})"
- name: Check Mbed OS versions
run: |
git submodule status --recursive
no_os_version=$(git submodule status --recursive | sed -nr 's/.(.*) libraries\/no-OS.*mbed-os.*/\1/p')
pcf_version=$(sed -e 's/.*#//' mbed-os.lib)
if [[ "${no_os_version}" != "${pcf_version}" ]]; then
echo "ERROR: MBed OS version in no-OS (${no_os_version}) does not match PCF (${pcf_version})"
exit 1
fi
echo "SUCCESS: MBed OS version in no-OS and PCF match (${no_os_version})"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update no-OS submodule
run: |
git submodule update --init libraries/no-OS
- name: Run astyle on source code
run: |
sudo apt-get update
sudo apt-get install -y astyle fd-find
set -e
formatted=$(fdfind -e c -e h . projects | xargs astyle --formatted --options=libraries/no-OS/ci/astyle_config)
if [[ ! -z "${formatted}" ]]; then
echo "ERROR: The following files were formatted by astyle:"
echo "${formatted}"
exit 1
fi
echo "SUCCESS: No files were formatted by astyle"
build:
runs-on: ubuntu-latest
needs: [check-versions, lint]
strategy:
matrix:
project:
- ad2s1210_iio
- ad405x_iio
- ad4130_iio
- ad559xr_console
- ad5770r_console
- ad579x_iio
- ad590_console
- ad5933_console
- ad7124_console
- ad7124_temperature-measure
- ad7134_iio
- ad717x_console
- ad717x_iio
- ad719x_iio
- ad738x_iio
- ad7606_iio
- ad7689_iio
- ad77681_iio
- ad777x_iio
- adt7420_console
- evb_discovery_firmware
- ltc2672_iio
- ltc268x_console
- nanodac_console
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with no-OS
run: |
set -x
pip install mbed-cli
wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
tar xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
export PATH="${PATH}:${PWD}/gcc-arm-none-eabi-10.3-2021.10/bin"
mbed config -G GCC_ARM_PATH "${PWD}/gcc-arm-none-eabi-10.3-2021.10/bin"
pushd libraries/no-OS/libraries/mbed/mbed-os
pip install -r requirements.txt
popd
pushd projects/${{ matrix.project }}
make
popd
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}
path: |
projects/${{ matrix.project }}/build/${{ matrix.project }}.bin