update: added support for IMU and Lottie JSON
This commit is contained in:
73
components/thorvg-main/.github/workflows/build_android.yml
vendored
Normal file
73
components/thorvg-main/.github/workflows/build_android.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: Android
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_x86_64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: nttld/setup-ndk@v1.3.1
|
||||
id: setup-ndk
|
||||
with:
|
||||
submodules: true
|
||||
ndk-version: r21e
|
||||
local-cache: true
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install meson ninja-build libgles-dev
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
API: 21
|
||||
run: |
|
||||
sed -e "s|NDK|$NDK|g" -e "s|HOST_TAG|linux-x86_64|g" -e "s|API|$API|g" ./cross/android_x86_64.txt > /tmp/android_cross.txt
|
||||
meson setup build -Dlog=true -Dengines="sw, gl" -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true -Dthreads=false -Dextra="lottie_exp" --cross-file /tmp/android_cross.txt
|
||||
sudo ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_x86_64
|
||||
path: build/src/libthorvg*
|
||||
|
||||
build_aarch64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: nttld/setup-ndk@v1.3.1
|
||||
id: setup-ndk
|
||||
with:
|
||||
submodules: true
|
||||
ndk-version: r21e
|
||||
local-cache: true
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install meson ninja-build libgles-dev
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
API: 21
|
||||
run: |
|
||||
sed -e "s|NDK|$NDK|g" -e "s|HOST_TAG|linux-x86_64|g" -e "s|API|$API|g" ./cross/android_aarch64.txt > /tmp/android_cross.txt
|
||||
meson setup build -Dlog=true -Dengines="sw, gl" -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true -Dthreads=false -Dextra="lottie_exp" --cross-file /tmp/android_cross.txt
|
||||
sudo ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_aarch64
|
||||
path: build/src/libthorvg*
|
||||
100
components/thorvg-main/.github/workflows/build_ios.yml
vendored
Normal file
100
components/thorvg-main/.github/workflows/build_ios.yml
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
name: iOS
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_simulator_x86_64:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
brew update
|
||||
brew install meson
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true -Dextra="lottie_exp" --cross-file ./cross/ios_simulator_x86_64.txt
|
||||
ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_simulator_x86_64
|
||||
path: build/src/libthorvg*
|
||||
|
||||
build_simulator_arm64:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
brew update
|
||||
brew install meson
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true -Dextra="lottie_exp" --cross-file ./cross/ios_simulator_arm64.txt
|
||||
ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_simulator_arm64
|
||||
path: build/src/libthorvg*
|
||||
|
||||
build_arm64:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
brew update
|
||||
brew install meson
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true -Dextra="lottie_exp" --cross-file ./cross/ios_arm64.txt
|
||||
ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_arm64
|
||||
path: build/src/libthorvg*
|
||||
88
components/thorvg-main/.github/workflows/build_macos.yml
vendored
Normal file
88
components/thorvg-main/.github/workflows/build_macos.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: macOS
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
brew update
|
||||
brew install meson sdl2
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dbindings=capi -Dtools=all -Dextra="lottie_exp"
|
||||
ninja -C build install
|
||||
|
||||
compact_test:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
brew update
|
||||
brew install meson
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dstatic=true -Dthreads=false -Dextra="lottie_exp"
|
||||
ninja -C build install
|
||||
|
||||
unit_test:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Unbreak Python in GitHub Actions
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
||||
sudo rm -rf /Library/Frameworks/Python.framework/
|
||||
brew install --force python3 && brew unlink python3 && brew link --overwrite python3
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
brew update
|
||||
brew install meson
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dloaders=all -Dsavers=all -Dbindings=capi -Dtests=true -Dextra="lottie_exp" --errorlogs
|
||||
ninja -C build install test
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnitTestReport
|
||||
path: build/meson-logs/testlog.txt
|
||||
92
components/thorvg-main/.github/workflows/build_ubuntu.yml
vendored
Normal file
92
components/thorvg-main/.github/workflows/build_ubuntu.yml
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
name: Ubuntu
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install meson ninja-build libturbojpeg0-dev libpng-dev libwebp-dev libgles-dev libsdl2-dev
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dengines="sw, gl" -Dloaders=all -Dsavers=all -Dbindings=capi -Dtools=all
|
||||
sudo ninja -C build install
|
||||
|
||||
compact_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install meson ninja-build libgles-dev
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dengines="sw, gl" -Dloaders=all -Dsavers=all -Dstatic=true -Dthreads=false
|
||||
sudo ninja -C build install
|
||||
|
||||
unit_test:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install meson ninja-build libgtest-dev libasan5 valgrind curl jq software-properties-common libturbojpeg0-dev libpng-dev libwebp-dev libgles-dev
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dloaders="all" -Dengines="sw, gl" -Dsavers="all" -Dbindings="capi" -Dtests=true --errorlogs
|
||||
sudo ninja -C build install test
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnitTestReport
|
||||
path: build/meson-logs/testlog.txt
|
||||
|
||||
- name: Run memcheck Script(valgrind)
|
||||
run: |
|
||||
export PATH=$PATH:~/.local/bin/
|
||||
chmod +x "${GITHUB_WORKSPACE}/.github/workflows/memcheck_valgrind.sh"
|
||||
"${GITHUB_WORKSPACE}/.github/workflows/memcheck_valgrind.sh"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build & Run memcheck Script(ASAN)
|
||||
run: |
|
||||
sudo rm -rf ./build
|
||||
meson setup build -Db_sanitize="address,undefined" -Dloaders="all" -Dsavers="all" -Dtests="true" -Dbindings="capi"
|
||||
sudo ninja -C build install
|
||||
export PATH=$PATH:~/.local/bin/
|
||||
chmod +x "${GITHUB_WORKSPACE}/.github/workflows/memcheck_asan.sh"
|
||||
"${GITHUB_WORKSPACE}/.github/workflows/memcheck_asan.sh"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
77
components/thorvg-main/.github/workflows/build_windows.yml
vendored
Normal file
77
components/thorvg-main/.github/workflows/build_windows.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: Windows
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
pip install meson ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dbindings=capi -Dtools=all
|
||||
where link
|
||||
ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_windows
|
||||
path: build/src/thorvg*
|
||||
|
||||
compact_test:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
pip install meson ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dlog=true -Dloaders=all -Dsavers=all -Dstatic=true -Dthreads=false
|
||||
where link
|
||||
ninja -C build install
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: result_windows_static
|
||||
path: build/src/thorvg*
|
||||
|
||||
unit_test:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
pip install meson ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
meson setup build -Dloaders=all -Dsavers=all -Dbindings=capi -Dtests=true --errorlogs
|
||||
where link
|
||||
ninja -C build install test
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnitTestReport
|
||||
path: build/meson-logs/testlog.txt
|
||||
|
||||
44
components/thorvg-main/.github/workflows/memcheck_asan.sh
vendored
Normal file
44
components/thorvg-main/.github/workflows/memcheck_asan.sh
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "$GITHUB_TOKEN" ]]; then
|
||||
echo "The GITHUB_TOKEN is required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||
echo "Run Address Sanitizer"
|
||||
echo "meson -Db_sanitize=\"address,undefined\" -Dloaders=\"all\" -Dsavers=\"all\" -Dtests=\"true\" -Dbindings=\"capi\" . build"
|
||||
pwd
|
||||
cd ${GITHUB_WORKSPACE}/build/test
|
||||
./tvgUnitTests > memcheck_asan.txt 2>&1
|
||||
|
||||
|
||||
PAYLOAD_MEMCHECK=`cat memcheck_asan.txt`
|
||||
COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url)
|
||||
|
||||
echo $COMMENTS_URL
|
||||
echo "MEMCHECK errors:"
|
||||
echo $PAYLOAD_MEMCHECK
|
||||
|
||||
if [[ $PAYLOAD_MEMCHECK == *"runtime error:"* || $PAYLOAD_MEMCHECK == *"ERROR: AddressSanitizer:"* ]]; then
|
||||
OUTPUT+=$'\n**MEMCHECK(ASAN) RESULT**:\n'
|
||||
|
||||
OUTPUT+=$'\n`meson -Db_sanitize="address,undefined" -Dloaders="all" -Dsavers="all" -Dtests="true" -Dbindings="capi" . build`\n'
|
||||
OUTPUT+=$'\n```\n'
|
||||
OUTPUT+="$PAYLOAD_MEMCHECK"
|
||||
OUTPUT+=$'\n```\n'
|
||||
|
||||
(
|
||||
echo '<details><summary>ASAN output</sumary>'
|
||||
echo
|
||||
echo "$OUTPUT"
|
||||
echo
|
||||
echo '</details>'
|
||||
) >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
|
||||
|
||||
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
|
||||
fi
|
||||
fi
|
||||
|
||||
45
components/thorvg-main/.github/workflows/memcheck_valgrind.sh
vendored
Normal file
45
components/thorvg-main/.github/workflows/memcheck_valgrind.sh
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "$GITHUB_TOKEN" ]]; then
|
||||
echo "The GITHUB_TOKEN is required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||
echo "Run Valgrind"
|
||||
echo "valgrind --leak-check=yes ./tvgUnitTests"
|
||||
cd ./build/test
|
||||
|
||||
valgrind --leak-check=yes ./tvgUnitTests > memcheck_valgrind.txt 2>&1
|
||||
|
||||
|
||||
PAYLOAD_MEMCHECK=`cat memcheck_valgrind.txt`
|
||||
COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url)
|
||||
|
||||
echo $COMMENTS_URL
|
||||
echo "MEMCHECK errors:"
|
||||
echo $PAYLOAD_MEMCHECK
|
||||
|
||||
DEFINITELY_LOST_NUMBER=$(echo "$PAYLOAD_MEMCHECK" | grep -oP 'definitely lost:\s*\K[0-9]+(?=\s*bytes in)')
|
||||
ERROR_NUMBER=$(echo "$PAYLOAD_MEMCHECK" | grep -oP 'ERROR SUMMARY:\s*\K[0-9]+(?=\s*errors)')
|
||||
if [[ $ERROR_NUMBER != 0 || $DEFINITELY_LOST_NUMBER != 0 || $PAYLOAD_MEMCHECK == *"Invalid read "* || $PAYLOAD_MEMCHECK == *"Invalid write "* ]]; then
|
||||
OUTPUT+=$'\n**MEMCHECK(VALGRIND) RESULT**:\n'
|
||||
OUTPUT+=$'\n`valgrind --leak-check=yes ./tvgUnitTests`\n'
|
||||
OUTPUT+=$'\n```\n'
|
||||
OUTPUT+="$PAYLOAD_MEMCHECK"
|
||||
OUTPUT+=$'\n```\n'
|
||||
|
||||
(
|
||||
echo '<details><summary>Valgrind output</sumary>'
|
||||
echo
|
||||
echo "$OUTPUT"
|
||||
echo
|
||||
echo '</details>'
|
||||
) >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
|
||||
|
||||
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
|
||||
fi
|
||||
fi
|
||||
|
||||
13
components/thorvg-main/.github/workflows/pull_request_label.yml
vendored
Normal file
13
components/thorvg-main/.github/workflows/pull_request_label.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
name: Pull Request Labeler
|
||||
|
||||
on: [pull_request_target]
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
sync-labels: true
|
||||
|
||||
192
components/thorvg-main/.github/workflows/regression.yml
vendored
Normal file
192
components/thorvg-main/.github/workflows/regression.yml
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
name: Regression
|
||||
|
||||
# on: [push, pull_request] - enable when testing
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install things
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y meson wget2 librsvg2-dev librsvg2-bin ninja-build git gcc-multilib g++-multilib earlyoom
|
||||
|
||||
- name: Compile Thorvg PR
|
||||
run: |
|
||||
meson . build -Dtools=svg2png,lottie2gif -Dsavers=gif -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
|
||||
sudo ninja -C build install
|
||||
cd ..
|
||||
|
||||
- name: Download SVG Regression finder and setup settings
|
||||
run: |
|
||||
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.4.0/svg_tester
|
||||
chmod +x ./svg_tester
|
||||
|
||||
- name: Prepare valid files to test
|
||||
run: |
|
||||
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgValidFiles.zip -O files.zip
|
||||
unzip -q files.zip
|
||||
rm files.zip
|
||||
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgNotValidFiles.zip -O files.zip
|
||||
unzip -q files.zip
|
||||
rm files.zip
|
||||
mv ThorvgValidFiles FilesToTest
|
||||
find ThorvgNotValidFiles -type f -exec mv {} FilesToTest \;
|
||||
rmdir ThorvgNotValidFiles
|
||||
|
||||
- name: Setup settings for crash/leak/timeout tests
|
||||
run: |
|
||||
mv test/regression/settings_crash_leak.toml settings.toml
|
||||
|
||||
- name: Run regression finder tests
|
||||
run: |
|
||||
./svg_tester 2>&1 | tee result_crashes.txt
|
||||
|
||||
- name: Setup settings for comparison tests
|
||||
run: |
|
||||
mv test/regression/settings_comparison.toml settings.toml
|
||||
|
||||
- name: Store Crashing/Leaking/Timing out Images
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: crashing-leaking-timeouting-images
|
||||
path: BrokenFILES
|
||||
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
|
||||
rm -rf BrokenFILES || true
|
||||
|
||||
# Test valid files
|
||||
- name: Prepare valid files to test
|
||||
run: |
|
||||
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgValidFiles.zip -O files.zip
|
||||
unzip -q files.zip
|
||||
rm files.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@v4
|
||||
with:
|
||||
name: differences-in-valid-files
|
||||
path: BrokenSVG
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Store Problematic Images for valid inputs
|
||||
uses: actions/upload-artifact@v4
|
||||
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
|
||||
rm -rf BrokenFILES || true
|
||||
|
||||
# Test files that may not work currently good with Thorvg, errors from this are not critical
|
||||
# it is possible that this will find also some improvements
|
||||
- name: Prepare not valid to test
|
||||
run: |
|
||||
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgNotValidFiles.zip -O files.zip
|
||||
unzip -q files.zip
|
||||
rm files.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@v4
|
||||
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@v4
|
||||
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
|
||||
rm -rf BrokenFILES || true
|
||||
|
||||
- name: Test png reproducibility
|
||||
run: |
|
||||
wget -q https://github.com/thorvg/thorvg/files/11356766/AA_5.svg.zip -O files.zip
|
||||
unzip -q files.zip
|
||||
rm files.zip
|
||||
cp test/regression/check_same_image_size.py check_same_image_size.py
|
||||
# Forces to run tasks on different threads if possible, which should help find problem with data races
|
||||
taskset -c 0-15 python3 check_same_image_size.py AA_5.svg ./build/src/tools/svg2png/tvg-svg2png 100 500 2>&1 | tee result_image_size.txt
|
||||
|
||||
- name: Check results
|
||||
run: |
|
||||
export PATH=$PATH:~/.local/bin/
|
||||
python3 "${GITHUB_WORKSPACE}/.github/workflows/regression_check.py"
|
||||
|
||||
if [[ -f "fail_ci.txt" ]]; then
|
||||
(
|
||||
echo '```'
|
||||
cat "fail_ci.txt"
|
||||
echo '```'
|
||||
) >> "$GITHUB_STEP_SUMMARY"
|
||||
fi
|
||||
|
||||
- name: Find Comment
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
comment-author: 'github-actions[bot]'
|
||||
body-includes: Regression report
|
||||
|
||||
# TODO - not works
|
||||
# - name: Create or update comment
|
||||
# uses: peter-evans/create-or-update-comment@v4
|
||||
# with:
|
||||
# comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
# issue-number: ${{ github.event.pull_request.number }}
|
||||
# body-path: 'comment.txt'
|
||||
# edit-mode: replace
|
||||
|
||||
- name: Fail CI if regression found
|
||||
run: |
|
||||
if [[ -f "fail_ci.txt" ]]; then
|
||||
echo "Check Check results section for more details which tests failed"
|
||||
exit 1
|
||||
fi
|
||||
67
components/thorvg-main/.github/workflows/regression_check.py
vendored
Normal file
67
components/thorvg-main/.github/workflows/regression_check.py
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
from typing import Optional
|
||||
|
||||
POSSIBLE_PROBLEM = "POSSIBLE_PROBLEM - "
|
||||
|
||||
|
||||
def check_file(file_name: str) -> Optional[str]:
|
||||
with open(file_name, "r") as file:
|
||||
print(f"Checking file {file_name}")
|
||||
for line in file:
|
||||
line = line.strip()
|
||||
if line.startswith(POSSIBLE_PROBLEM):
|
||||
return line[len(POSSIBLE_PROBLEM) :]
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
data_to_check = [
|
||||
(
|
||||
"result_valid_files.txt",
|
||||
True,
|
||||
"Found difference in converting images that properly converted in develop branch.",
|
||||
),
|
||||
(
|
||||
"result_not_valid_files.txt",
|
||||
False,
|
||||
"Found differences in converting images that were not properly converted in develop branch(this may be improvement).",
|
||||
),
|
||||
(
|
||||
"result_image_size.txt",
|
||||
True,
|
||||
"Generated png have different size in each run.",
|
||||
),
|
||||
(
|
||||
"result_crashes.txt",
|
||||
True,
|
||||
"Found crashes in crashes during when converting svg to png.",
|
||||
),
|
||||
]
|
||||
|
||||
fail_ci = False
|
||||
comment = ""
|
||||
for file_name, fail_ci_when_triggered, new_comment in data_to_check:
|
||||
possible_problem = check_file(file_name)
|
||||
if possible_problem is not None:
|
||||
print(f">>>>> Found changes in {file_name} (look at CI steps from above)")
|
||||
print(f"Comment: {new_comment}")
|
||||
|
||||
if fail_ci_when_triggered:
|
||||
fail_ci = True
|
||||
comment += new_comment + "\n"
|
||||
|
||||
to_write = "Regression report:\n"
|
||||
|
||||
if len(comment) > 0:
|
||||
to_write += comment
|
||||
to_write += "\nCheck CI for artifacts/logs for more details."
|
||||
else:
|
||||
to_write += "Not found any changes(both improvements and regressions) in this PR with test data."
|
||||
|
||||
print("\n\n" + to_write + "\n\n")
|
||||
|
||||
with open("comment.txt", "w") as file:
|
||||
file.write(to_write)
|
||||
|
||||
if fail_ci:
|
||||
with open("fail_ci.txt", "w") as file:
|
||||
file.write("Fail")
|
||||
20
components/thorvg-main/.github/workflows/release.yml
vendored
Normal file
20
components/thorvg-main/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: "thorvg"
|
||||
- name: Create source archive
|
||||
run: |
|
||||
rm -rf ./thorvg/.git*
|
||||
tar -I "gzip -9" -cf thorvg.tar.gz thorvg
|
||||
- name: Upload to release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: thorvg.tar.gz
|
||||
Reference in New Issue
Block a user