Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 14, 2023
1 parent 75e85f9 commit 2d18077
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 155 deletions.
117 changes: 62 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,116 @@ name: CI

on:
push:
branches:
- 'master'
pull_request:
schedule:
- cron: '31 1,12 * * *'

jobs:
ubuntu:
runs-on: ubuntu-latest
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout V
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Checkout c2v
uses: actions/checkout@v2
- name: Checkout C2V
uses: actions/checkout@v4
with:
path: c2v

- name: Install Dependencies
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libpng-dev libsamplerate0-dev
if [ "${{ runner.os }}" == "Linux" ]; then
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 V
run: make && ./v symlink -githubci

- name: Build c2v and setup ~/code
run: make -j4 && ./v symlink -githubci
- name: Setup C2V
run: |
ls -la /home/runner/work/c2v/c2v/c2v
ln -s /home/runner/work/c2v/c2v/c2v ~/.vmodules/c2v
mkdir -p ~/code/
v -g ~/.vmodules/c2v/
~/.vmodules/c2v/c2v || true
- name: Test c2v
mv c2v ~/.vmodules/c2v
v -g ~/.vmodules/c2v/ || true
- name: Test C2V
run: |
v -g test ~/.vmodules/c2v/
v -g run ~/.vmodules/c2v/tests/run_tests.vsh
- name: Build original Chocolate Doom
run: |
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
cd ~/code/doom/chocolate-doom
cmake -DCMAKE_BUILD_TYPE=Debug .
make chocolate-doom
- name: Translate just p_enemy.v
run: |
cd ~/.vmodules/c2v/
v -g run tools/build_doom_file.vsh doom/p_enemy
- name: Translate the whole game in project/folder mode
run: |
cd ~/code/doom
touch ~/DOOM1.WAD
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
macos:
runs-on: macos-latest
test-regressions:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
VFLAGS: -cc tcc
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: true
VTMP: /tmp
steps:
- name: Checkout V
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Checkout c2v
uses: actions/checkout@v2
- name: Checkout C2V
uses: actions/checkout@v4
with:
path: c2v

- name: Install Dependencies
run: brew install sdl2 sdl2_mixer sdl2_net libpng libsamplerate

- 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
# vgret dependencies
# imagemagick : convert, mogrify, import
# xvfb : For starting X11 Virtual FrameBuffers
# openimageio-tools : idiff
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
# freeglut3-dev : Fixes graphic apps compilation with tcc
sudo apt install imagemagick openimageio-tools freeglut3-dev libgl1-mesa-dri xvfb xsel xclip
- name: Build V
run: make && ./v symlink -githubci

- name: Build c2v and setup ~/code
run: make -j4 && ./v symlink -githubci
- name: Setup C2V
run: |
ls -la /Users/runner/work/c2v/c2v/c2v
ln -s /Users/runner/work/c2v/c2v/c2v ~/.vmodules/c2v
mkdir -p ~/code/
v -g ~/.vmodules/c2v/
~/.vmodules/c2v/c2v || true
- name: Test c2v
mv c2v ~/.vmodules/c2v
v -g ~/.vmodules/c2v/ || true
- name: Test C2V
run: |
v -g test ~/.vmodules/c2v/
v -g run ~/.vmodules/c2v/tests/run_tests.vsh
- name: Build original Chocolate Doom
run: |
git clone --quiet --depth 1 https://github.com/vlang/doom ~/code/doom
cd ~/code/doom/chocolate-doom
cmake -DCMAKE_BUILD_TYPE=Debug .
make chocolate-doom
- name: Translate just p_enemy.v
run: |
cd ~/.vmodules/c2v/
v -g run tools/build_doom_file.vsh doom/p_enemy
- name: Translate the whole game in project/folder mode
run: WAD_FILE=~/doom1.wad ~/code/doom/build_whole_project.sh
- name: Sample and compare
id: compare
continue-on-error: true
run: |
cd ~/code/doom
touch ~/DOOM1.WAD
WAD_FILE=~/DOOM1.WAD ~/code/doom/build_whole_project.sh
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; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
- name: Upload regression to imgur
if: steps.compare.outcome != 'success'
run: |
./imgur.sh /tmp/fail.png
./imgur.sh /tmp/diff.png
exit 1
100 changes: 0 additions & 100 deletions .github/workflows/doom_gfx_regressions.yml

This file was deleted.

0 comments on commit 2d18077

Please sign in to comment.