mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
ci: update c2v workflow, translate doom on macOS (#19562)
This commit is contained in:
parent
a8743e1c51
commit
d30cbdb351
2 changed files with 44 additions and 66 deletions
102
.github/workflows/c2v_ci.yml
vendored
102
.github/workflows/c2v_ci.yml
vendored
|
@ -3,63 +3,64 @@ name: C2V apps
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- '**.md'
|
||||||
- "**.yml"
|
- '**.yml'
|
||||||
- "doc/**"
|
- '!**/c2v_ci.yml'
|
||||||
- "examples/**"
|
- 'doc/**'
|
||||||
- "tutorials/**"
|
- 'examples/**'
|
||||||
|
- 'tutorials/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- '**.md'
|
||||||
- "**.yml"
|
- '**.yml'
|
||||||
- "doc/**"
|
- '!**/c2v_ci.yml'
|
||||||
- "examples/**"
|
- 'doc/**'
|
||||||
- "tutorials/**"
|
- 'examples/**'
|
||||||
|
- 'tutorials/**'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build-c2v-apps-${{ github.event.pull_request.number || github.sha }}
|
group: build-c2v-apps-${{ github.event.pull_request.number || github.sha }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
doom-compiles:
|
build-doom:
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||||
timeout-minutes: 30
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04, macos-12]
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build V
|
- name: Build V
|
||||||
run: make && ./v symlink -githubci
|
run: make && ./v symlink -githubci
|
||||||
|
- name: Install C2V
|
||||||
- name: Build C2V
|
|
||||||
run: |
|
run: |
|
||||||
echo "Clone C2V"
|
v install --git https://github.com/vlang/c2v
|
||||||
mkdir -p ~/code/
|
v -g ~/.vmodules/c2v/ || true
|
||||||
git clone --depth 1 https://github.com/vlang/c2v ~/code/c2v
|
- name: Install dependencies
|
||||||
ln -s ~/code/c2v ~/.vmodules/c2v
|
|
||||||
v -g ~/.vmodules/c2v/
|
|
||||||
~/.vmodules/c2v/c2v || true
|
|
||||||
|
|
||||||
- name: Install Doom Dependencies
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y -qq
|
if [ "${{ runner.os }}" == "Linux" ]; then
|
||||||
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
|
sudo apt update -y -qq
|
||||||
|
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
|
||||||
|
else
|
||||||
|
brew install sdl2 sdl2_mixer sdl2_net libpng libsamplerate
|
||||||
|
fi
|
||||||
- name: Build original Chocolate Doom
|
- name: Build original Chocolate Doom
|
||||||
run: |
|
run: |
|
||||||
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
|
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
|
||||||
cd ~/code/doom/chocolate-doom
|
cd ~/code/doom/chocolate-doom
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug .
|
cmake -DCMAKE_BUILD_TYPE=Debug .
|
||||||
make chocolate-doom
|
make chocolate-doom
|
||||||
|
|
||||||
- name: Translate the whole game in project/folder mode and compile it
|
- name: Translate the whole game in project/folder mode and compile it
|
||||||
run: |
|
run: |
|
||||||
cd ~/code/doom
|
|
||||||
touch ~/DOOM1.WAD
|
touch ~/DOOM1.WAD
|
||||||
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
|
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
|
||||||
|
|
||||||
doom-regressions:
|
test-regression:
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
env:
|
env:
|
||||||
VFLAGS: -cc tcc
|
VFLAGS: -cc tcc
|
||||||
|
@ -67,56 +68,42 @@ jobs:
|
||||||
LIBGL_ALWAYS_SOFTWARE: true
|
LIBGL_ALWAYS_SOFTWARE: true
|
||||||
VTMP: /tmp
|
VTMP: /tmp
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build V
|
- name: Build V
|
||||||
run: make && ./v symlink -githubci
|
run: make && ./v symlink -githubci
|
||||||
|
- name: Install C2V
|
||||||
- name: Setup dependencies
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y -qq
|
v install --git https://github.com/vlang/c2v
|
||||||
|
v -g ~/.vmodules/c2v/ || true
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update -y -qq
|
||||||
|
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
|
||||||
# c2v / DOOM dependencies
|
# c2v / DOOM dependencies
|
||||||
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
|
|
||||||
|
|
||||||
# vgret dependencies
|
# vgret dependencies
|
||||||
# imagemagick : convert, mogrify, import
|
# imagemagick : convert, mogrify, import
|
||||||
# xvfb : For starting X11 Virtual FrameBuffers
|
# xvfb : For starting X11 Virtual FrameBuffers
|
||||||
# openimageio-tools : idiff
|
# openimageio-tools : idiff
|
||||||
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
|
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
|
||||||
# freeglut3-dev : Fixes graphic apps compilation with tcc
|
# freeglut3-dev : Fixes graphic apps compilation with tcc
|
||||||
sudo apt-get install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
|
sudo apt install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
|
||||||
|
- name: Setup test tools
|
||||||
|
run: |
|
||||||
# Fetch the free ~4MB DOOM1.WAD from the link at https://doomwiki.org/wiki/DOOM1.WAD
|
# Fetch the free ~4MB DOOM1.WAD from the link at https://doomwiki.org/wiki/DOOM1.WAD
|
||||||
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
|
wget https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad -O ~/doom1.wad
|
||||||
|
|
||||||
# Get imgur upload script
|
# Get imgur upload script
|
||||||
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
|
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
|
||||||
chmod +x ./imgur.sh
|
chmod +x ./imgur.sh
|
||||||
|
|
||||||
# Get regression images to test against
|
# Get regression images to test against
|
||||||
git clone https://github.com/Larpon/doom-regression-images
|
git clone https://github.com/Larpon/doom-regression-images
|
||||||
|
|
||||||
- name: Build C2V
|
|
||||||
run: |
|
|
||||||
echo "Clone C2V"
|
|
||||||
mkdir -p ~/code/
|
|
||||||
git clone --depth 1 https://github.com/vlang/c2v ~/code/c2v
|
|
||||||
ln -s ~/code/c2v ~/.vmodules/c2v
|
|
||||||
v -g ~/.vmodules/c2v/
|
|
||||||
~/.vmodules/c2v/c2v || true
|
|
||||||
|
|
||||||
- name: Build original Chocolate Doom
|
- name: Build original Chocolate Doom
|
||||||
run: |
|
run: |
|
||||||
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
|
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
|
||||||
cd ~/code/doom/chocolate-doom
|
cd ~/code/doom/chocolate-doom
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug .
|
cmake -DCMAKE_BUILD_TYPE=Debug .
|
||||||
make chocolate-doom
|
make chocolate-doom
|
||||||
|
|
||||||
- name: Translate the whole game in project/folder mode
|
- name: Translate the whole game in project/folder mode
|
||||||
run: |
|
run: WAD_FILE=~/doom1.wad ~/code/doom/build_whole_project.sh
|
||||||
cd ~/code/doom
|
|
||||||
WAD_FILE=~/doom1.wad ~/code/doom/build_whole_project.sh
|
|
||||||
|
|
||||||
- name: Sample and compare with vgret
|
- name: Sample and compare with vgret
|
||||||
id: compare
|
id: compare
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
@ -124,7 +111,6 @@ jobs:
|
||||||
Xvfb $DISPLAY -screen 0 800x600x24 -fbdir /var/tmp/ &
|
Xvfb $DISPLAY -screen 0 800x600x24 -fbdir /var/tmp/ &
|
||||||
sleep 1; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
|
sleep 1; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
|
||||||
sleep 1; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
|
sleep 1; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
|
||||||
|
|
||||||
- name: Upload regression to imgur
|
- name: Upload regression to imgur
|
||||||
if: steps.compare.outcome != 'success'
|
if: steps.compare.outcome != 'success'
|
||||||
run: |
|
run: |
|
||||||
|
|
8
.github/workflows/macos_ci.yml
vendored
8
.github/workflows/macos_ci.yml
vendored
|
@ -73,14 +73,6 @@ jobs:
|
||||||
../v -autofree .
|
../v -autofree .
|
||||||
../v -prod .
|
../v -prod .
|
||||||
cd ..
|
cd ..
|
||||||
# - name: Test c2v
|
|
||||||
# run: |
|
|
||||||
# git clone --depth 1 https://github.com/vlang/c2v
|
|
||||||
# cd c2v && ../v -o c2v .
|
|
||||||
# ../v .
|
|
||||||
# ../v run tests/run_tests.vsh
|
|
||||||
# ../v -experimental -w c2v_test.v
|
|
||||||
# cd ..
|
|
||||||
- name: Build V UI examples
|
- name: Build V UI examples
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://github.com/vlang/ui
|
git clone --depth 1 https://github.com/vlang/ui
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue