2021-12-11 10:30:06 +03:00
|
|
|
name: Graphics CI
|
|
|
|
|
|
|
|
on:
|
2022-05-15 09:06:01 +03:00
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
2021-12-11 10:30:06 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
gg-regressions:
|
2022-07-05 22:44:27 +03:00
|
|
|
runs-on: ubuntu-latest
|
2022-05-22 20:19:04 +03:00
|
|
|
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
2021-12-11 10:30:06 +03:00
|
|
|
timeout-minutes: 10
|
|
|
|
env:
|
|
|
|
VFLAGS: -cc tcc
|
|
|
|
DISPLAY: :99
|
2022-07-05 22:44:27 +03:00
|
|
|
LIBGL_ALWAYS_SOFTWARE: true
|
2021-12-11 10:30:06 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout V
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build local v
|
2022-06-10 15:38:50 +03:00
|
|
|
run: make
|
|
|
|
|
2021-12-11 10:30:06 +03:00
|
|
|
- name: Setup dependencies
|
|
|
|
run: |
|
2022-06-10 15:38:50 +03:00
|
|
|
# imagemagick : convert, mogrify
|
2022-07-05 22:44:27 +03:00
|
|
|
# xvfb : xvfb
|
2021-12-11 10:30:06 +03:00
|
|
|
# openimageio-tools : idiff
|
|
|
|
# libxcursor-dev libxi-dev : V gfx deps
|
2022-07-05 22:44:27 +03:00
|
|
|
# libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
|
2021-12-11 10:30:06 +03:00
|
|
|
# freeglut3-dev : Fixes graphic apps compilation with tcc
|
2022-06-10 11:50:30 +03:00
|
|
|
sudo apt-get update
|
2022-09-04 13:46:27 +03:00
|
|
|
sudo apt-get install imagemagick openimageio-tools libgl1-mesa-dri xvfb libxcursor-dev libxi-dev freeglut3-dev xsel xclip
|
2021-12-11 10:30:06 +03:00
|
|
|
wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
|
2022-06-10 15:38:50 +03:00
|
|
|
git clone https://github.com/Larpon/gg-regression-images gg-regression-images
|
2021-12-11 10:30:06 +03:00
|
|
|
chmod +x ./imgur.sh
|
|
|
|
|
|
|
|
- name: Sample and compare
|
|
|
|
id: compare
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
|
|
Xvfb $DISPLAY -screen 0 1280x1024x24 &
|
2022-07-05 22:44:27 +03:00
|
|
|
sleep 1 # give xvfb time to start
|
2021-12-13 21:58:31 +03:00
|
|
|
./v gret -t ./gg-regression-images/vgret.v_examples.toml -v ./gg-sample_images ./gg-regression-images
|
2021-12-11 10:30:06 +03:00
|
|
|
|
|
|
|
- name: Upload regression to imgur
|
|
|
|
if: steps.compare.outcome != 'success'
|
|
|
|
run: |
|
|
|
|
./imgur.sh /tmp/fail.png
|
2022-06-10 15:38:50 +03:00
|
|
|
./imgur.sh /tmp/diff.png
|
2021-12-11 10:30:06 +03:00
|
|
|
exit 1
|