Skip to content

Commit d30cbdb

Browse files
authored
ci: update c2v workflow, translate doom on macOS (#19562)
1 parent a8743e1 commit d30cbdb

File tree

2 files changed

+44
-66
lines changed

2 files changed

+44
-66
lines changed

.github/workflows/c2v_ci.yml

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,128 +3,114 @@ name: C2V apps
33
on:
44
push:
55
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/**'
1112
pull_request:
1213
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/**'
1820

1921
concurrency:
2022
group: build-c2v-apps-${{ github.event.pull_request.number || github.sha }}
2123
cancel-in-progress: true
2224

2325
jobs:
24-
doom-compiles:
25-
runs-on: ubuntu-20.04
26+
build-doom:
2627
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
2834
steps:
29-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3036
- name: Build V
3137
run: make && ./v symlink -githubci
32-
33-
- name: Build C2V
38+
- name: Install C2V
3439
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
4343
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
4750
- name: Build original Chocolate Doom
4851
run: |
4952
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
5053
cd ~/code/doom/chocolate-doom
5154
cmake -DCMAKE_BUILD_TYPE=Debug .
5255
make chocolate-doom
53-
5456
- name: Translate the whole game in project/folder mode and compile it
5557
run: |
56-
cd ~/code/doom
5758
touch ~/DOOM1.WAD
5859
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
5960
60-
doom-regressions:
61-
runs-on: ubuntu-20.04
61+
test-regression:
6262
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
63+
runs-on: ubuntu-20.04
6364
timeout-minutes: 20
6465
env:
6566
VFLAGS: -cc tcc
6667
DISPLAY: :99
6768
LIBGL_ALWAYS_SOFTWARE: true
6869
VTMP: /tmp
6970
steps:
70-
- uses: actions/checkout@v3
71+
- uses: actions/checkout@v4
7172
- name: Build V
7273
run: make && ./v symlink -githubci
73-
74-
- name: Setup dependencies
74+
- name: Install C2V
7575
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
7882
# c2v / DOOM dependencies
79-
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
80-
8183
# vgret dependencies
8284
# imagemagick : convert, mogrify, import
8385
# xvfb : For starting X11 Virtual FrameBuffers
8486
# openimageio-tools : idiff
8587
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
8688
# 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: |
8992
# Fetch the free ~4MB DOOM1.WAD from the link at https://doomwiki.org/wiki/DOOM1.WAD
9093
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
91-
9294
# Get imgur upload script
9395
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
9496
chmod +x ./imgur.sh
95-
9697
# Get regression images to test against
9798
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-
10899
- name: Build original Chocolate Doom
109100
run: |
110101
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
111102
cd ~/code/doom/chocolate-doom
112103
cmake -DCMAKE_BUILD_TYPE=Debug .
113104
make chocolate-doom
114-
115105
- 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
120107
- name: Sample and compare with vgret
121108
id: compare
122109
continue-on-error: true
123110
run: |
124111
Xvfb $DISPLAY -screen 0 800x600x24 -fbdir /var/tmp/ &
125112
sleep 1; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
126113
sleep 1; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
127-
128114
- name: Upload regression to imgur
129115
if: steps.compare.outcome != 'success'
130116
run: |

.github/workflows/macos_ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ jobs:
7373
../v -autofree .
7474
../v -prod .
7575
cd ..
76-
# - name: Test c2v
77-
# run: |
78-
# git clone --depth 1 https://github.com/vlang/c2v
79-
# cd c2v && ../v -o c2v .
80-
# ../v .
81-
# ../v run tests/run_tests.vsh
82-
# ../v -experimental -w c2v_test.v
83-
# cd ..
8476
- name: Build V UI examples
8577
run: |
8678
git clone --depth 1 https://github.com/vlang/ui

0 commit comments

Comments
 (0)