Skip to content

Commit fc1318a

Browse files
committed
added automated workflow for ev3 executable compilation
1 parent 69f6d4d commit fc1318a

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

.github/workflows/ev3-compile.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
ev3-compile.yml: name: ev3 compile
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Build Docker image
20+
run: docker build -t ev3dev-cpp-compiler .
21+
22+
- name: Make script executable
23+
run: chmod +x ./compile_all.sh
24+
25+
- name: Run script (generates main1, main2, main3, main4, main5)
26+
run: ./compile_all.sh
27+
28+
- name: Create GitHub Release
29+
uses: softprops/action-gh-release@v1
30+
with:
31+
tag_name: master-${{ github.sha }}
32+
name: "Master Release ${{ github.sha }}"
33+
files: |
34+
main1
35+
main2
36+
main3
37+
main4
38+
main5

compile_all.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
sudo docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main1.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main1 -std=c++14 -lm -pthread -lstdc++fs
1+
set -euo pipefail
2+
3+
docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main1.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main1 -std=c++14 -lm -pthread -lstdc++fs
24
echo "main1 compiled"
3-
sudo docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main2.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main2 -std=c++14 -lm -pthread -lstdc++fs
5+
docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main2.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main2 -std=c++14 -lm -pthread -lstdc++fs
46
echo "main2 compiled"
5-
sudo docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main3.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main3 -std=c++14 -lm -pthread -lstdc++fs
7+
docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main3.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main3 -std=c++14 -lm -pthread -lstdc++fs
68
echo "main3 compiled"
7-
sudo docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main4.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main4 -std=c++14 -lm -pthread -lstdc++fs
9+
docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main4.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main4 -std=c++14 -lm -pthread -lstdc++fs
810
echo "main4 compiled"
9-
sudo docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main5.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main5 -std=c++14 -lm -pthread -lstdc++fs
11+
docker run --rm -v $(pwd):/src ev3dev-cpp-compiler -mcpu=arm926ej-s -march=armv5te -marm -O3 -Wl,--gc-sections -fdata-sections -ffunction-sections -Wall -Wextra -Wshadow -Werror=return-type -flto src/mains/main5.cpp src/motor.cpp src/position.cpp src/sensor.cpp src/diferential_drive.cpp src/robot.cpp -o main5 -std=c++14 -lm -pthread -lstdc++fs
1012
echo "main5 compiled"
1113

1214
#scp main robot@10.42.0.3:/home/robot/libc++/

0 commit comments

Comments
 (0)