-
Notifications
You must be signed in to change notification settings - Fork 637
/
ci_script.sh
executable file
·46 lines (43 loc) · 1.31 KB
/
ci_script.sh
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
#!/bin/bash
set -x -e -v
cd code
case "$1" in
("host")
# runs unit tests, using the host compiler and the esp8266 mock framework
# - https://github.com/esp8266/Arduino/blob/master/tests/host/Makefile
# - https://github.com/ThrowTheSwitch/Unity
pushd test/unit
cmake -B build
cmake --build build
cmake --build build --target test
popd
;;
("webui")
npm exec --no -- vitest --environment jsdom --dir html/spec --run
npm exec --no -- eslint
npm exec --no -- html-validate html/src/*.html
# checks whether the webui can be built
./build.sh -f environments
# TODO: gzip inserts an OS-dependant byte in the header, ref.
# - https://datatracker.ietf.org/doc/html/rfc1952
# - https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/deps/zlib/deflate.c#L901
# - windowBits description in the https://zlib.net/manual.html#Advanced
git --no-pager diff --stat
;;
("build")
# simply build the given environment
pio run -e $2
;;
("test")
# run generic build test with the specified environment as base
scripts/test_build.py -e $2
;;
("release")
# TODO: pending removal in favour of code/scripts/generate_release_sh.py
./build.sh -r
;;
(*)
echo -e "\e[1;33mUnknown stage name, exiting!\e[0m"
exit 1
;;
esac