mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
127 lines
3.9 KiB
YAML
127 lines
3.9 KiB
YAML
name: <Native> Run Tests
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
unit-test-with-cmake:
|
|
name: "Run on windows"
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ${{github.workspace}}/native
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Downlad external libraties
|
|
run: |
|
|
npm install
|
|
npm install gulp -g
|
|
node ./utils/download-deps.js
|
|
|
|
- name: Generate bindings
|
|
shell: bash
|
|
run: |
|
|
python -m pip install PyYAML==5.4.1 Cheetah3
|
|
python ./tools/tojs/genbindings.py
|
|
|
|
- name: Run Unit Tests
|
|
shell: bash
|
|
run: |
|
|
cmake -B tests/unit-test/build -S tests/unit-test
|
|
cmake --build tests/unit-test/build --config Release
|
|
./tests/unit-test/build/src/Release/CocosTest.exe
|
|
|
|
#### TODO(PatriceJiang): model split
|
|
# - name: Run Module Tests
|
|
# shell: bash
|
|
# run: |
|
|
# cd tests/module-tests
|
|
# bash run-test-windows.sh
|
|
sebind-with-windows:
|
|
name: "sebind tests"
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ${{github.workspace}}/native
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Downlad external libraties
|
|
run: |
|
|
npm install
|
|
npm install gulp -g
|
|
node ./utils/download-deps.js
|
|
|
|
- name: Generate bindings
|
|
shell: bash
|
|
run: |
|
|
python -m pip install PyYAML==5.4.1 Cheetah3
|
|
python ./tools/tojs/genbindings.py
|
|
|
|
- name: Run Sebind Tests
|
|
shell: bash
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/native
|
|
cp -r ../templates/windows tests/sebind-tests/win64
|
|
cd tests/sebind-tests
|
|
mkdir -p proj
|
|
cp cfg.cmake proj/
|
|
GW="${GITHUB_WORKSPACE//\\/\/}"
|
|
cmake -B proj -S win64 -DRES_DIR="${GW}/native/tests/sebind-tests" -DCOCOS_X_PATH="${GW}/native" -DAPP_NAME=sebind
|
|
cmake --build proj
|
|
# cd proj/Debug
|
|
## can not boot on this machine
|
|
# ./sebind.exe || true
|
|
# if [[ -f "result.txt" ]];
|
|
# then
|
|
# echo "success!"
|
|
# else
|
|
# echo "Run sebind-tests fail!"
|
|
# exit 1
|
|
# fi
|
|
|
|
# sebind-run-on-linux:
|
|
# name: "Test sebind on Ubuntu"
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v2
|
|
# - name: Download external libraries
|
|
# shell: bash
|
|
# run: |
|
|
# EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
|
|
# git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external
|
|
# - name: Generate bindings
|
|
# run: |
|
|
# python3 -m pip install PyYAML==5.4.1 Cheetah3
|
|
# python3 ./native/tools/tojs/genbindings.py
|
|
# rm ./native/tools/tojs/userconf.ini
|
|
# - name: Install dependencies
|
|
# run: |
|
|
# sudo apt install libx11-dev -y
|
|
# sudo apt install libsndio-dev -y
|
|
# sudo apt install ninja-build -y
|
|
# - name: Run Sebind Tests
|
|
# shell: bash
|
|
# run: |
|
|
# cd ${GITHUB_WORKSPACE}/native
|
|
# cp -r ../templates/linux tests/sebind-tests/linux
|
|
# cd tests/sebind-tests
|
|
# mkdir -p proj
|
|
# cp cfg.cmake proj
|
|
# cmake -G Ninja -B proj -S linux -DRES_DIR=${GITHUB_WORKSPACE}/native/tests/sebind-tests/ -DCOCOS_X_PATH=${GITHUB_WORKSPACE}/native -DAPP_NAME=sebind
|
|
# cmake --build proj
|
|
# cd proj
|
|
# ./sebind || true
|
|
# if [[ -f "result.txt" ]];
|
|
# then
|
|
# echo "success!"
|
|
# else
|
|
# echo "Run sebind-tests fail!" > /dev/stderr
|
|
# fi
|