File tree Expand file tree Collapse file tree 2 files changed +58
-16
lines changed
Expand file tree Collapse file tree 2 files changed +58
-16
lines changed Original file line number Diff line number Diff line change 1+ name : Test build
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ workflow_dispatch :
7+ schedule :
8+ - cron : " 15 3 * * 2"
9+
10+ jobs :
11+ os_matrix :
12+ strategy :
13+ matrix :
14+ os : [ubuntu-latest, macos-latest, windows-latest]
15+ runs-on : ${{ matrix.os }}
16+ steps :
17+ - name : Build
18+ run : |
19+ git clone https://github.com/embroidermodder/libembroidery
20+ cd libembroidery
21+ bash build.sh --github
Original file line number Diff line number Diff line change 22#
33# This file is part of libembroidery.
44#
5- # This needs the "./" part because it used to run the program as well as build it.
6- BUILD_DIR=./build
7- TEST_DIR=./test
8- EMB=$TEST_DIR /embroider
5+ EMB=./test/embroider
96TEST_TIME=10
107TOTAL_TESTS=13
118
129function test_build () {
1310 CC=gcc
1411 OPTIONS=" -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror"
15- rm -fr $TEST_DIR
16- mkdir $TEST_DIR
12+ rm -fr test
13+ mkdir test
1714 time $CC $OPTIONS src/embroider.c -o $EMB -lm
18- cd $TEST_DIR
1915}
2016
2117function test_wrap () {
@@ -78,27 +74,52 @@ function all_tests () {
7874 render_cross_test logo
7975}
8076
81- if [ " $1 " = " --test-full " ] ; then
77+ function test_full () {
8278
8379 date & > test_full.log
8480 test_build & >> test_full.log
8581 time all_tests & >> test_full.log
8682
87- elif [ " $1 " = " --test" ]; then
83+ }
84+
85+ function test_main () {
8886
8987 date & > test.log
9088 test_build & >> test.log
9189 time fast_tests & >> test.log
9290
93- elif [ " $1 " = " --clean" ]; then
94-
95- rm -fr $BUILD_DIR $TEST_DIR
91+ }
9692
97- else
93+ function cmake_build () {
9894
99- mkdir -f $BUILD_DIR & > build.log
100- cd $BUILD_DIR & >> build.log
95+ mkdir -f build & > build.log
96+ cd build & >> build.log
10197 cmake .. & >> build.log
10298 cmake --build . & >> build.log
10399
104- fi
100+ }
101+
102+ while [[ $# -gt 0 ]]; do
103+ case $1 in
104+ --test-full)
105+ test_full
106+ ;;
107+ --test)
108+ test_main
109+ ;;
110+ --github)
111+ test_build
112+ ;;
113+ --cmake-build)
114+ cmake_build
115+ ;;
116+ --clean)
117+ rm -fr $BUILD_DIR $TEST_DIR
118+ ;;
119+ * )
120+ echo " Unrecognised option: $1 "
121+ ;;
122+ esac
123+ shift
124+ done
125+
You can’t perform that action at this time.
0 commit comments