thorvg/.github/workflows/regression.yml

120 lines
4 KiB
YAML

name: Regression
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install things
run: |
sudo apt-get update
sudo apt-get install -y wget2 librsvg2-dev librsvg2-bin ninja-build git gcc-multilib g++-multilib
sudo pip3 install meson
- name: Compile Thorvg PR
run: |
meson . build -Dtools=svg2png -Db_sanitize=address,undefined
sudo ninja -C build install
- name: Compile Thorvg Develop
run: |
git clone https://github.com/thorvg/thorvg.git thorvg_develop
cd thorvg_develop
meson . build -Dtools=svg2png -Db_sanitize=address,undefined
sudo ninja -C build install
cd ..
- name: Download SVG Regression finder and setup settings
run: |
wget https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/svg_tester
chmod +x ./svg_tester
mv test/regression/settings.toml settings.toml
# Test valid files
- name: Prepare valid files to test
run: |
wget https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgValidFiles.zip
unzip ThorvgValidFiles.zip
mv ThorvgValidFiles FilesToTest
- name: Run regression finder tests
run: |
./svg_tester 2>&1 | tee result_valid_files.txt
- name: Store Broken Images for valid inputs
uses: actions/upload-artifact@v3
with:
name: differences-in-valid-files
path: BrokenSVG
if-no-files-found: ignore
- name: Store Problematic Images for valid inputs
uses: actions/upload-artifact@v3
with:
name: problematic-images-in-valid-files
path: ProblematicSVG
if-no-files-found: ignore
- name: Clean Data
run: |
rm -rf BrokenSVG || true
rm -rf FilesToTest || true
rm -rf ProblematicSVG || true
rm -rf IgnoredSVG || true
# Test files that may not work currently good with Thorvg, errors from this are not critical
- name: Prepare not valid to test
run: |
wget https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgNotValidFiles.zip
unzip ThorvgNotValidFiles.zip
mv ThorvgNotValidFiles FilesToTest
- name: Run invalid files tests
run: |
./svg_tester 2>&1 | tee result_not_valid_files.txt
- name: Store Broken Images for not valid inputs
uses: actions/upload-artifact@v3
with:
name: differences-in-not-valid-files
path: BrokenSVG
if-no-files-found: ignore
- name: Store Problematic Images for not valid inputs
uses: actions/upload-artifact@v3
with:
name: problematic-images-in-not-valid-files
path: ProblematicSVG
if-no-files-found: ignore
- name: Clean Data
run: |
rm -rf BrokenSVG || true
rm -rf FilesToTest || true
rm -rf ProblematicSVG || true
rm -rf IgnoredSVG || true
- name: Test png reproducibility
run: |
wget https://github.com/thorvg/thorvg/files/11356766/AA_5.svg.zip
unzip AA_5.svg.zip
cp test/regression/check_same_image_size.py check_same_image_size.py
taskset -c 0-15 python3 check_same_image_size.py AA_5.svg ./build/src/bin/svg2png/svg2png 100 500 2>&1 | tee result_image_size.txt
- name: Add comment to PR
run: |
export PATH=$PATH:~/.local/bin/
chmod +x "${GITHUB_WORKSPACE}/.github/workflows/regression_check.sh"
"${GITHUB_WORKSPACE}/.github/workflows/regression_check.sh"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Failing should happen after creating comment PR and passing all tests
- name: Fail if needed
run: |
if [ -f "EXIT_REQUESTED" ]; then false; fi