infra: updated gitaction CI build test with MacOS

@Issue: https://github.com/thorvg/thorvg/issues/1433
This commit is contained in:
Hermet Park 2023-09-13 11:06:07 +09:00 committed by Hermet Park
parent 6b3bd8b27a
commit 5b8999e417
8 changed files with 156 additions and 160 deletions

View file

@ -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
View 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

View file

@ -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

View file

@ -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
View 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

View file

@ -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"

View file

@ -1,4 +1,4 @@
name: Regression Testing name: Regression
on: on:
pull_request: pull_request:

View file

@ -3,8 +3,9 @@
[![Discord](https://img.shields.io/badge/Community-5865f2?style=flat&logo=discord&logoColor=white)](https://discord.gg/n25xj6J6HM) [![Discord](https://img.shields.io/badge/Community-5865f2?style=flat&logo=discord&logoColor=white)](https://discord.gg/n25xj6J6HM)
<br> <br>
[![CodeFactor](https://www.codefactor.io/repository/github/hermet/thorvg/badge)](https://www.codefactor.io/repository/github/hermet/thorvg) [![CodeFactor](https://www.codefactor.io/repository/github/hermet/thorvg/badge)](https://www.codefactor.io/repository/github/hermet/thorvg)
[![Build Linux](https://github.com/thorvg/thorvg/actions/workflows/build_linux.yml/badge.svg?branch=main&event=push)](https://github.com/thorvg/thorvg/actions/workflows/actions.yml) [![Build Ubuntu](https://github.com/thorvg/thorvg/actions/workflows/build_ubuntu.yml/badge.svg?branch=main&event=push)](https://github.com/thorvg/thorvg/actions/workflows/build_ubuntu.yml)
[![Build Windows](https://github.com/thorvg/thorvg/actions/workflows/build_win.yml/badge.svg?branch=main&event=push)](https://github.com/thorvg/thorvg/actions/workflows/build_win.yml) [![Build Windows](https://github.com/thorvg/thorvg/actions/workflows/build_windows.yml/badge.svg?branch=main&event=push)](https://github.com/thorvg/thorvg/actions/workflows/build_windows.yml)
[![Build MacOS](https://github.com/thorvg/thorvg/actions/workflows/build_macos.yml/badge.svg?branch=main&event=push)](https://github.com/thorvg/thorvg/actions/workflows/build_macos.yml)
# ThorVG # ThorVG
<p align="center"> <p align="center">