v2 / .github / workflows / gg_regressions_ci.yml
72 lines · 64 sloc · 2.5 KB · a51ed8416224e15d17196584165f9fae71ec613f
Raw
1name: Graphics CI
2
3on:
4 push:
5 paths:
6 - 'vlib/**'
7 - 'thirdparty/**'
8 - 'cmd/tools/builders/**.v'
9 - '**/gg_regressions_ci.yml'
10 - '!**.md'
11 pull_request:
12 paths:
13 - 'vlib/**'
14 - 'thirdparty/**'
15 - 'cmd/tools/builders/**.v'
16 - '**/gg_regressions_ci.yml'
17 - '!**.md'
18
19concurrency:
20 group: gg-regressions-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
21 cancel-in-progress: true
22
23jobs:
24 gg-regressions:
25 runs-on: ubuntu-24.04
26 timeout-minutes: 20
27 env:
28 VFLAGS: -cc tcc
29 DISPLAY: :99
30 LIBGL_ALWAYS_SOFTWARE: true
31 VTMP: /tmp
32 steps:
33 - name: Checkout V
34 uses: actions/checkout@v6
35 - uses: ./.github/actions/cache-apt-packages-action
36
37 - name: Build local v
38 run: make -j4 && ./v symlink
39
40 - name: Clear module cache
41 run: ./v wipe-cache
42
43 - name: Setup dependencies
44 run: |
45 # imagemagick : convert, mogrify
46 # xvfb : xvfb
47 # openimageio-tools : idiff
48 # libxcursor-dev libxi-dev : V gfx deps
49 # libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true)
50 # freeglut3-dev : Fixes graphic apps compilation with tcc
51 # libx11-dev : X11 headers for clipboard and sokol (default backend on Linux)
52 .github/workflows/disable_azure_mirror.sh
53 ./v retry -- sudo apt update
54 ./v retry -- sudo apt install imagemagick openimageio-tools libgl1-mesa-dri xvfb libxcursor-dev libxi-dev libxrandr-dev freeglut3-dev xsel xclip libx11-dev libegl-dev
55 ./v retry -- ./v download https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh
56 ./v retry -- git clone https://github.com/Larpon/gg-regression-images gg-regression-images
57 chmod +x ./imgur.sh
58
59 - name: Sample and compare
60 id: compare
61 continue-on-error: true
62 run: |
63 Xvfb "$DISPLAY" -screen 0 1280x1024x24 -fbdir /var/tmp/ &
64 sleep 2; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
65 sleep 5; ./v gret -t ./gg-regression-images/vgret.v_examples.toml -v ./gg-sample_images ./gg-regression-images
66
67 - name: Upload regression to imgur
68 if: steps.compare.outcome != 'success'
69 run: |
70 ./imgur.sh /tmp/fail.png
71 ./imgur.sh /tmp/diff.png
72 exit 1
73