.github/workflows/build-test.yml #1045
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
schedule: | |
- cron: '00 6 * * *' | |
workflow_dispatch: | |
jobs: | |
code-check: | |
name: code_check | |
runs-on: self-hosted | |
env: | |
CTEST_FAIL_ON_WARNING: "1" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check code. | |
run: | | |
source create-mirco-python-venv | |
find src/ tests/ -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp | xargs clang-format -style=file -i -fallback-style=none | |
git diff > clang_format.patch | |
if [ -s clang_format.patch ] | |
then | |
echo "Formatting incorrect. Run 'find src/ tests/ -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp | xargs clang-format -style=file -i -fallback-style=none' in your local source directory and push it." | |
exit 1 | |
fi | |
mirco-test: | |
name: mirco_test_full | |
runs-on: self-hosted | |
env: | |
CTEST_FAIL_ON_WARNING: "1" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Delete old build files. | |
run: rm -rf ../mirco_build/ | |
- name: Clear ccache cache. | |
run: 'if [ -x "$(command -v ccache)" ]; then ccache -C -z; echo "ccache cache cleared"; fi' | |
- name: Run build and ctest | |
run: 'ctest -S ${{github.workspace}}/tests/testconfig/test_release.cmake -VV || tee ../buildtest.log' |