1 | name: Graphics CI |
2 | |
3 | on: |
4 | push: |
5 | paths-ignore: |
6 | - "**.md" |
7 | pull_request: |
8 | paths-ignore: |
9 | - "**.md" |
10 | |
11 | jobs: |
12 | gg-regressions: |
13 | runs-on: ubuntu-20.04 |
14 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
15 | timeout-minutes: 20 |
16 | env: |
17 | VFLAGS: -cc tcc |
18 | DISPLAY: :99 |
19 | LIBGL_ALWAYS_SOFTWARE: true |
20 | VTMP: /tmp |
21 | steps: |
22 | - name: Checkout V |
23 | uses: actions/checkout@v3 |
24 | |
25 | - name: Build local v |
26 | run: make |
27 | |
28 | - name: Setup dependencies |
29 | run: | |
30 | # imagemagick : convert, mogrify |
31 | # xvfb : xvfb |
32 | # openimageio-tools : idiff |
33 | # libxcursor-dev libxi-dev : V gfx deps |
34 | # libgl1-mesa-dri : For headless rendering / software DRI driver (LIBGL_ALWAYS_SOFTWARE=true) |
35 | # freeglut3-dev : Fixes graphic apps compilation with tcc |
36 | sudo apt-get update |
37 | sudo apt-get install imagemagick openimageio-tools libgl1-mesa-dri xvfb libxcursor-dev libxi-dev freeglut3-dev xsel xclip |
38 | wget https://raw.githubusercontent.com/tremby/imgur.sh/c98345d/imgur.sh |
39 | git clone https://github.com/Larpon/gg-regression-images gg-regression-images |
40 | chmod +x ./imgur.sh |
41 | |
42 | - name: Sample and compare |
43 | id: compare |
44 | continue-on-error: true |
45 | run: | |
46 | Xvfb $DISPLAY -screen 0 1280x1024x24 -fbdir /var/tmp/ & |
47 | sleep 1; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs |
48 | sleep 1; ./v gret -t ./gg-regression-images/vgret.v_examples.toml -v ./gg-sample_images ./gg-regression-images |
49 | |
50 | - name: Upload regression to imgur |
51 | if: steps.compare.outcome != 'success' |
52 | run: | |
53 | ./imgur.sh /tmp/fail.png |
54 | ./imgur.sh /tmp/diff.png |
55 | exit 1 |