-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (79 loc) · 2.19 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Windows(msys2)
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-2022
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: ucrt64
install: >-
git
curl
unzip
diffutils
mingw-w64-ucrt-x86_64-make
mingw-w64-ucrt-x86_64-clang
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: images
key: key
- id: cached
uses: andstor/file-existence-action@v3
with:
files: "images, qoi_test_images"
- name: get test/benchmark suite
if: steps.cached.outputs.files_exists == 'false'
shell: msys2 {0}
run: |
curl -O https://qoiformat.org/qoi_test_images.zip
unzip qoi_test_images.zip
rm qoi_test_images.zip
curl https://qoiformat.org/benchmark/qoi_benchmark_suite.tar | tar x
- name: build reference qoiconv
shell: msys2 {0}
run: |
pushd .dependencies/qoi
ln -s ../stb/stb_image.h .
ln -s ../stb/stb_image_write.h .
mingw32-make conv
popd
mv .dependencies/qoi/qoiconv.exe bin/qoiconv_orig.exe
- name: build
shell: msys2 {0}
run: CXX=clang++ mingw32-make -j
- name: test
shell: msys2 {0}
run: |
pushd qoi_test_images
mkdir -p /tmp/qoixx
mkdir -p /tmp/qoi
for i in ./*.qoi; do
# test decode
../bin/qoiconv ${i} /tmp/qoixx/${i%.*}.png
../bin/qoiconv_orig ${i} /tmp/qoi/${i%.*}.png
diff /tmp/qoi{,xx}/${i%.*}.png
done
rm -rf /tmp/qoixx/*.png
rm -rf /tmp/qoi/*.png
for i in ./*.png; do
# test encode
../bin/qoiconv ${i} /tmp/qoixx/${i%.*}.qoi
../bin/qoiconv_orig /tmp/qoixx/${i%.*}.qoi /tmp/qoixx/${i}
../bin/qoiconv_orig ${i} /tmp/qoi/${i%.*}.qoi
../bin/qoiconv_orig /tmp/qoi/${i%.*}.qoi /tmp/qoi/${i}
diff /tmp/qoi{,xx}/${i}
done
popd
bin/test
- name: run
shell: msys2 {0}
run: bin/qoibench 1 images --noreference --nowarmup