File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Cub3D CI
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v3
15+
16+ - name : Install dependencies
17+ run : |
18+ sudo apt-get update
19+ sudo apt-get install -y gcc make xorg libxext-dev libbsd-dev valgrind
20+
21+ - name : Compile project
22+ run : |
23+ make re
24+ ls -la cub3D
25+
26+ - name : Basic map validation
27+ run : |
28+ ./cub3D maps/invalid_map.cub 2>&1 | grep "Error" && exit 1 || echo "Map validation working"
29+ ./cub3D maps/valid_map.cub 2>&1 | grep "Error" && exit 1 || echo "Valid map accepted"
30+
31+ - name : Run with Valgrind (leak check)
32+ run : |
33+ valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 \
34+ --track-origins=yes --log-file=valgrind.log \
35+ ./cub3D maps/valid_map.cub
36+ cat valgrind.log
37+
38+ - name : Output verification
39+ run : |
40+ timeout 5 ./cub3D maps/valid_map.cub > output.log 2>&1 &
41+ sleep 3
42+ grep "Initialization complete" output.log || (echo "Startup failed" && exit 1)
43+ killall cub3D
44+
45+ - name : Save artifacts on failure
46+ if : failure()
47+ uses : actions/upload-artifact@v3
48+ with :
49+ name : debug-logs
50+ path : |
51+ output.log
52+ valgrind.log
You can’t perform that action at this time.
0 commit comments