mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
add githup action job for unit test (#3355)
This commit is contained in:
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
name: Cmake Unit Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
camke-unit:
|
||||
# The CMake configure and build commands are platform agnostic and should work equally
|
||||
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||
# cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
#runs-on: windows-latest
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Create build directory
|
||||
run: mkdir -p ${{github.workspace}}/unit-test/build
|
||||
|
||||
- name: Downlad external libraties
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/external
|
||||
run: |
|
||||
cd ${{github.workspace}}/external
|
||||
external_version=`grep version config.json |awk -F'"' '{print $4}'`
|
||||
external_repo_name=`grep name config.json |awk -F'"' '{print $4}'`
|
||||
external_repo_parent=`grep owner config.json |awk -F'"' '{print $4}'`
|
||||
rm ${{github.workspace}}/external/*
|
||||
git clone --branch ${external_version} --depth 1 https://github.com/${external_repo_parent}/${external_repo_name} .
|
||||
git log --oneline -1
|
||||
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/unit-test/build
|
||||
run: pwd && cd ${{github.workspace}}/unit-test/build && cmake .. -G"Unix Makefiles"
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/unit-test/build
|
||||
shell: bash
|
||||
run: pwd && cd ${{github.workspace}}/unit-test/build && make V=1
|
||||
|
||||
- name: Run Test
|
||||
working-directory: ${{github.workspace}}/unit-test/build
|
||||
shell: bash
|
||||
run: pwd && cd ${{github.workspace}}/unit-test/build && ./src/CocosTest
|
||||
Reference in New Issue
Block a user