MacOS Build and Test #74
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
name: MacOS Build and Test | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: macos-latest | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Building with Python script | |
run: python build.py | |
- name: Check 'SpaceEngine' library build success | |
run: | | |
if [ -e build/core/libSpaceEngine.a ]; then | |
echo "SpaceEngine library exists." | |
else | |
echo "SpaceEngine library not found. Failing the CI test." | |
exit 1 | |
fi | |
- name: Check 'SpaceEditor' executable build success | |
run: | | |
if [ -e build/editor/SpaceEditor ]; then | |
echo "SpaceEditor executable exists." | |
else | |
echo "SpaceEditor executable not found. Failing the CI test." | |
exit 1 | |
fi | |
- name: Check 'SpaceTests' executable build success | |
run: | | |
if [ -e build/tests/SpaceTests ]; then | |
echo "SpaceTests executable exists." | |
else | |
echo "SpaceTests executable not found. Failing the CI test." | |
exit 1 | |
fi | |
- name: Run tests | |
run: | | |
cd build/tests | |
./SpaceTests > test_output.txt 2>&1 | |
- name: Check test results | |
run: | | |
if grep -q "failed" build/tests/test_output.txt; then | |
echo "Tests failed." | |
exit 1 | |
else | |
echo "Tests passed." | |
fi |