Fix edge case in decoder when very first OP is QOI_OP_RUN / Add CI with official test suite #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ubuntu | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
ci-ubuntu: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: install clang | |
shell: bash | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" >> ./llvm.list | |
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" >> ./llvm.list | |
sudo mv llvm.list /etc/apt/sources.list.d | |
sudo apt update -y | |
sudo apt install clang-17 -y | |
- 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: bash | |
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 | |
- name: test | |
shell: bash | |
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: bash | |
run: bin/qoibench 1 images --noreference --nowarmup |