Files
cocos4/native/.github/workflows/cmake.yml
T
2021-03-26 18:30:12 +08:00

46 lines
1.7 KiB
YAML

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