Skip to content

Commit

Permalink
add CI with official test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
wx257osn2 committed Feb 21, 2024
1 parent 2a60261 commit 7db71e1
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 13 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ jobs:
- id: cached
uses: andstor/file-existence-action@v3
with:
files: images
- name: get benchmark suite
files: "images, qoi_test_images"
- name: get test/benchmark suite
if: steps.cached.outputs.files_exists == 'false'
shell: bash
run: curl https://qoiformat.org/benchmark/qoi_benchmark_suite.tar | tar x
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: bash
run: |
pushd .dependencies/qoi
ln -s ../stb/stb_image.h .
ln -s ../stb/stb_image_write.h .
make conv
popd
mv .dependencies/qoi/qoiconv bin/qoiconv_orig
- name: build
shell: bash
run: CXX=clang++-17 make -j
Expand All @@ -42,4 +55,24 @@ jobs:
run: bin/qoibench 1 images --noreference --nowarmup
- name: test
shell: bash
run: bin/test
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%.*}.qoi /tmp/qoi/${i}
diff /tmp/qoi{,xx}/${i}
done
popd
bin/test
41 changes: 37 additions & 4 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,24 @@ jobs:
- id: cached
uses: andstor/file-existence-action@v3
with:
files: images
- name: get benchmark suite
files: "images, qoi_test_images"
- name: get test/benchmark suite
if: steps.cached.outputs.files_exists == 'false'
shell: bash
run: curl https://qoiformat.org/benchmark/qoi_benchmark_suite.tar | tar x
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: bash
run: |
pushd .dependencies/qoi
ln -s ../stb/stb_image.h .
ln -s ../stb/stb_image_write.h .
make conv
popd
mv .dependencies/qoi/qoiconv bin/qoiconv_orig
- name: build
shell: bash
run: CXX=$(brew --prefix llvm@17)/bin/clang++ make -j
Expand All @@ -36,4 +49,24 @@ jobs:
run: bin/qoibench 1 images --noreference --nowarmup
- name: test
shell: bash
run: bin/test
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%.*}.qoi /tmp/qoi/${i}
diff /tmp/qoi{,xx}/${i}
done
popd
bin/test
44 changes: 39 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
install: >-
git
curl
unzip
mingw-w64-ucrt-x86_64-make
mingw-w64-ucrt-x86_64-clang
- uses: actions/checkout@v4
Expand All @@ -29,11 +30,24 @@ jobs:
- id: cached
uses: andstor/file-existence-action@v3
with:
files: images
- name: get benchmark suite
files: "images, qoi_test_images"
- name: get test/benchmark suite
if: steps.cached.outputs.files_exists == 'false'
shell: bash
run: curl https://qoiformat.org/benchmark/qoi_benchmark_suite.tar | tar x
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
Expand All @@ -42,4 +56,24 @@ jobs:
run: bin/qoibench 1 images --noreference --nowarmup
- name: test
shell: msys2 {0}
run: bin/test
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%.*}.qoi /tmp/qoi/${i}
diff /tmp/qoi{,xx}/${i}
done
popd
bin/test

0 comments on commit 7db71e1

Please sign in to comment.