mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
infra: updated gitaction CI build test with MacOS
@Issue: https://github.com/thorvg/thorvg/issues/1433
This commit is contained in:
parent
6b3bd8b27a
commit
5b8999e417
8 changed files with 156 additions and 160 deletions
34
.github/workflows/actions_cpplint.yml
vendored
34
.github/workflows/actions_cpplint.yml
vendored
|
@ -1,34 +0,0 @@
|
||||||
name: Check Commit
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
coding-style:
|
|
||||||
if: ${{ false }} # disable for now
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install curl
|
|
||||||
sudo apt-get install cmake jq clang
|
|
||||||
sudo apt-get install software-properties-common
|
|
||||||
sudo apt-get install python3-pip
|
|
||||||
pip3 install wheel --user
|
|
||||||
pip3 install cpplint --user
|
|
||||||
|
|
||||||
- name: Run Cpplint Script
|
|
||||||
run: |
|
|
||||||
export PATH=$PATH:~/.local/bin/
|
|
||||||
chmod +x "${GITHUB_WORKSPACE}/.github/workflows/cpp_lint_check.sh"
|
|
||||||
"${GITHUB_WORKSPACE}/.github/workflows/cpp_lint_check.sh"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
71
.github/workflows/build_macos.yml
vendored
Normal file
71
.github/workflows/build_macos.yml
vendored
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
name: MacOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
brew update
|
||||||
|
brew install meson efl
|
||||||
|
brew upgrade
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson . build -Dlog=true -Dexamples=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all"
|
||||||
|
ninja -C build install
|
||||||
|
|
||||||
|
static_loaders:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
brew update
|
||||||
|
brew install meson
|
||||||
|
brew upgrade
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson . build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all" -Dstatic=true
|
||||||
|
ninja -C build install
|
||||||
|
|
||||||
|
unit_test:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
brew update
|
||||||
|
brew install meson
|
||||||
|
brew upgrade
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson . build -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtests=true --errorlogs
|
||||||
|
ninja -C build install test
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: UnitTestReport
|
||||||
|
path: build/meson-logs/testlog.txt
|
|
@ -1,4 +1,4 @@
|
||||||
name: Linux
|
name: Ubuntu
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -10,7 +10,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -19,18 +19,19 @@ jobs:
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install ninja-build gcc-multilib g++-multilib
|
sudo apt-get install ninja-build gcc-multilib g++-multilib libunwind-dev
|
||||||
|
sudo apt-get install libefl-all-dev
|
||||||
sudo apt-get install python3-pip
|
sudo apt-get install python3-pip
|
||||||
sudo apt-get install libturbojpeg0-dev libpng-dev libwebp-dev
|
sudo apt-get install libturbojpeg0-dev libpng-dev libwebp-dev
|
||||||
sudo pip3 install meson
|
sudo pip3 install meson
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
meson . build -Dlog=true -Dloaders="all, webp_beta" -Dsavers="all" -Dbindings="capi" -Dtools="all"
|
meson . build -Dlog=true -Dexamples=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all"
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
|
|
||||||
static_loaders:
|
static_loaders:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -48,29 +49,8 @@ jobs:
|
||||||
meson . build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all" -Dstatic=true
|
meson . build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all" -Dstatic=true
|
||||||
sudo ninja -C build install
|
sudo ninja -C build install
|
||||||
|
|
||||||
examples:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install ninja-build gcc-multilib g++-multilib
|
|
||||||
sudo apt-get install libefl-all-dev
|
|
||||||
sudo apt-get install python3-pip
|
|
||||||
sudo apt-get install libturbojpeg0-dev libpng-dev libwebp-dev
|
|
||||||
sudo pip3 install meson
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
meson . build -Dexamples=true -Dloaders="all, webp_beta" -Dsavers="all" -Dbindings="capi"
|
|
||||||
sudo ninja -C build install
|
|
||||||
|
|
||||||
unit_test:
|
unit_test:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -88,7 +68,7 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
meson . build -Dtests=true -Dloaders="all, webp_beta" -Dsavers="all" -Dbindings="capi" --errorlogs
|
meson . build -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtests=true --errorlogs
|
||||||
sudo ninja -C build install test
|
sudo ninja -C build install test
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
29
.github/workflows/build_win.yml
vendored
29
.github/workflows/build_win.yml
vendored
|
@ -1,29 +0,0 @@
|
||||||
name: Windows
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
pip install meson==0.58.0 ninja
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
meson --backend=ninja build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all"
|
|
||||||
where link
|
|
||||||
ninja -C build install
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: result
|
|
||||||
path: build/src\thorvg*
|
|
73
.github/workflows/build_windows.yml
vendored
Normal file
73
.github/workflows/build_windows.yml
vendored
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
name: Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pip install meson==0.58.0 ninja
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson --backend=ninja build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all"
|
||||||
|
where link
|
||||||
|
ninja -C build install
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: result
|
||||||
|
path: build/src/thorvg*
|
||||||
|
|
||||||
|
static_loaders:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pip install meson==0.58.0 ninja
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson --backend=ninja build -Dlog=true -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtools="all" -Dstatic=true
|
||||||
|
where link
|
||||||
|
ninja -C build install
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: result
|
||||||
|
path: build/src/thorvg*
|
||||||
|
|
||||||
|
unit_test:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pip install meson==0.58.0 ninja
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
meson --backend=ninja build -Dloaders="all" -Dsavers="all" -Dbindings="capi" -Dtests=true --errorlogs
|
||||||
|
where link
|
||||||
|
ninja -C build install test
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: UnitTestReport
|
||||||
|
path: build/meson-logs/testlog.txt
|
66
.github/workflows/cpp_lint_check.sh
vendored
66
.github/workflows/cpp_lint_check.sh
vendored
|
@ -1,66 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [[ -z "$GITHUB_TOKEN" ]]; then
|
|
||||||
echo "The GITHUB_TOKEN is required."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FILES_LINK=`jq -r '.pull_request._links.self.href' "$GITHUB_EVENT_PATH"`/files
|
|
||||||
echo "Files = $FILES_LINK"
|
|
||||||
|
|
||||||
curl $FILES_LINK > files.json
|
|
||||||
FILES_URLS_STRING=`jq -r '.[].raw_url' files.json`
|
|
||||||
|
|
||||||
readarray -t URLS <<<"$FILES_URLS_STRING"
|
|
||||||
|
|
||||||
echo "File names: $URLS"
|
|
||||||
|
|
||||||
mkdir files
|
|
||||||
cd files
|
|
||||||
for i in "${URLS[@]}"
|
|
||||||
do
|
|
||||||
echo "Downloading $i"
|
|
||||||
curl -LOk --remote-name $i
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Files downloaded!"
|
|
||||||
echo "Performing checkup:"
|
|
||||||
|
|
||||||
cpplint --filter=-,\
|
|
||||||
+whitespace/parens,\
|
|
||||||
+whitespace/indent,\
|
|
||||||
+whitespace/end_of_line,\
|
|
||||||
+whitespace/blank_line \
|
|
||||||
--extension=cpp,h,c \
|
|
||||||
--recursive \
|
|
||||||
./ > cpp-report.txt 2>&1
|
|
||||||
|
|
||||||
PAYLOAD_CPPLINT=`cat cpp-report.txt`
|
|
||||||
COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url)
|
|
||||||
|
|
||||||
echo $COMMENTS_URL
|
|
||||||
echo "Cppcheck errors:"
|
|
||||||
echo $PAYLOAD_CPPLINT
|
|
||||||
|
|
||||||
if [[ $PAYLOAD_CPPLINT == *"Total errors found: "* ]]; then
|
|
||||||
OUTPUT+=$'\n**CODING STYLE CHECK**:\n'
|
|
||||||
OUTPUT+=$'\n```\n'
|
|
||||||
OUTPUT+="$PAYLOAD_CPPLINT"
|
|
||||||
OUTPUT+=$'\n```\n'
|
|
||||||
fi
|
|
||||||
|
|
||||||
curl $COMMENTS_URL > comments.json
|
|
||||||
EXIST_COMMENTS=`jq -r '.[] | select(.body | contains("*CODING STYLE CHECK*")) | .id' comments.json`
|
|
||||||
echo $EXIST_COMMENTS
|
|
||||||
for exist_comment in $EXIST_COMMENTS
|
|
||||||
do
|
|
||||||
echo "---------------------"
|
|
||||||
echo $exist_comment
|
|
||||||
COMMENT_URL="https://api.github.com/repos/Samsung/thorvg/issues/comments/""$exist_comment"
|
|
||||||
curl -X "DELETE" -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" "$COMMENT_URL"
|
|
||||||
echo "=================="
|
|
||||||
done
|
|
||||||
|
|
||||||
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"
|
|
2
.github/workflows/regression.yml
vendored
2
.github/workflows/regression.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Regression Testing
|
name: Regression
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
[](https://discord.gg/n25xj6J6HM)
|
[](https://discord.gg/n25xj6J6HM)
|
||||||
<br>
|
<br>
|
||||||
[](https://www.codefactor.io/repository/github/hermet/thorvg)
|
[](https://www.codefactor.io/repository/github/hermet/thorvg)
|
||||||
[](https://github.com/thorvg/thorvg/actions/workflows/actions.yml)
|
[](https://github.com/thorvg/thorvg/actions/workflows/build_ubuntu.yml)
|
||||||
[](https://github.com/thorvg/thorvg/actions/workflows/build_win.yml)
|
[](https://github.com/thorvg/thorvg/actions/workflows/build_windows.yml)
|
||||||
|
[](https://github.com/thorvg/thorvg/actions/workflows/build_macos.yml)
|
||||||
|
|
||||||
# ThorVG
|
# ThorVG
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|
Loading…
Add table
Reference in a new issue