@@ -3,128 +3,114 @@ name: C2V apps
3
3
on :
4
4
push :
5
5
paths-ignore :
6
- - " **.md"
7
- - " **.yml"
8
- - " doc/**"
9
- - " examples/**"
10
- - " tutorials/**"
6
+ - ' **.md'
7
+ - ' **.yml'
8
+ - ' !**/c2v_ci.yml'
9
+ - ' doc/**'
10
+ - ' examples/**'
11
+ - ' tutorials/**'
11
12
pull_request :
12
13
paths-ignore :
13
- - " **.md"
14
- - " **.yml"
15
- - " doc/**"
16
- - " examples/**"
17
- - " tutorials/**"
14
+ - ' **.md'
15
+ - ' **.yml'
16
+ - ' !**/c2v_ci.yml'
17
+ - ' doc/**'
18
+ - ' examples/**'
19
+ - ' tutorials/**'
18
20
19
21
concurrency :
20
22
group : build-c2v-apps-${{ github.event.pull_request.number || github.sha }}
21
23
cancel-in-progress : true
22
24
23
25
jobs :
24
- doom-compiles :
25
- runs-on : ubuntu-20.04
26
+ build-doom :
26
27
if : github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
27
- timeout-minutes : 30
28
+ strategy :
29
+ matrix :
30
+ os : [ubuntu-20.04, macos-12]
31
+ fail-fast : false
32
+ runs-on : ${{ matrix.os }}
33
+ timeout-minutes : 20
28
34
steps :
29
- - uses : actions/checkout@v3
35
+ - uses : actions/checkout@v4
30
36
- name : Build V
31
37
run : make && ./v symlink -githubci
32
-
33
- - name : Build C2V
38
+ - name : Install C2V
34
39
run : |
35
- echo "Clone C2V"
36
- mkdir -p ~/code/
37
- git clone --depth 1 https://github.com/vlang/c2v ~/code/c2v
38
- ln -s ~/code/c2v ~/.vmodules/c2v
39
- v -g ~/.vmodules/c2v/
40
- ~/.vmodules/c2v/c2v || true
41
-
42
- - name : Install Doom Dependencies
40
+ v install --git https://github.com/vlang/c2v
41
+ v -g ~/.vmodules/c2v/ || true
42
+ - name : Install dependencies
43
43
run : |
44
- sudo apt-get update -y -qq
45
- sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
46
-
44
+ if [ "${{ runner.os }}" == "Linux" ]; then
45
+ sudo apt update -y -qq
46
+ sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
47
+ else
48
+ brew install sdl2 sdl2_mixer sdl2_net libpng libsamplerate
49
+ fi
47
50
- name : Build original Chocolate Doom
48
51
run : |
49
52
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
50
53
cd ~/code/doom/chocolate-doom
51
54
cmake -DCMAKE_BUILD_TYPE=Debug .
52
55
make chocolate-doom
53
-
54
56
- name : Translate the whole game in project/folder mode and compile it
55
57
run : |
56
- cd ~/code/doom
57
58
touch ~/DOOM1.WAD
58
59
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
59
60
60
- doom-regressions :
61
- runs-on : ubuntu-20.04
61
+ test-regression :
62
62
if : github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
63
+ runs-on : ubuntu-20.04
63
64
timeout-minutes : 20
64
65
env :
65
66
VFLAGS : -cc tcc
66
67
DISPLAY : :99
67
68
LIBGL_ALWAYS_SOFTWARE : true
68
69
VTMP : /tmp
69
70
steps :
70
- - uses : actions/checkout@v3
71
+ - uses : actions/checkout@v4
71
72
- name : Build V
72
73
run : make && ./v symlink -githubci
73
-
74
- - name : Setup dependencies
74
+ - name : Install C2V
75
75
run : |
76
- sudo apt-get update -y -qq
77
-
76
+ v install --git https://github.com/vlang/c2v
77
+ v -g ~/.vmodules/c2v/ || true
78
+ - name : Install dependencies
79
+ run : |
80
+ sudo apt update -y -qq
81
+ sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
78
82
# c2v / DOOM dependencies
79
- sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
80
-
81
83
# vgret dependencies
82
84
# imagemagick : convert, mogrify, import
83
85
# xvfb : For starting X11 Virtual FrameBuffers
84
86
# openimageio-tools : idiff
85
87
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
86
88
# freeglut3-dev : Fixes graphic apps compilation with tcc
87
- sudo apt-get install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
88
-
89
+ sudo apt install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
90
+ - name : Setup test tools
91
+ run : |
89
92
# Fetch the free ~4MB DOOM1.WAD from the link at https://doomwiki.org/wiki/DOOM1.WAD
90
93
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
91
-
92
94
# Get imgur upload script
93
95
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
94
96
chmod +x ./imgur.sh
95
-
96
97
# Get regression images to test against
97
98
git clone https://github.com/Larpon/doom-regression-images
98
-
99
- - name : Build C2V
100
- run : |
101
- echo "Clone C2V"
102
- mkdir -p ~/code/
103
- git clone --depth 1 https://github.com/vlang/c2v ~/code/c2v
104
- ln -s ~/code/c2v ~/.vmodules/c2v
105
- v -g ~/.vmodules/c2v/
106
- ~/.vmodules/c2v/c2v || true
107
-
108
99
- name : Build original Chocolate Doom
109
100
run : |
110
101
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
111
102
cd ~/code/doom/chocolate-doom
112
103
cmake -DCMAKE_BUILD_TYPE=Debug .
113
104
make chocolate-doom
114
-
115
105
- name : Translate the whole game in project/folder mode
116
- run : |
117
- cd ~/code/doom
118
- WAD_FILE=~/doom1.wad ~/code/doom/build_whole_project.sh
119
-
106
+ run : WAD_FILE=~/doom1.wad ~/code/doom/build_whole_project.sh
120
107
- name : Sample and compare with vgret
121
108
id : compare
122
109
continue-on-error : true
123
110
run : |
124
111
Xvfb $DISPLAY -screen 0 800x600x24 -fbdir /var/tmp/ &
125
112
sleep 1; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
126
113
sleep 1; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
127
-
128
114
- name : Upload regression to imgur
129
115
if : steps.compare.outcome != 'success'
130
116
run : |
0 commit comments