Format whole project #104
Workflow file for this run
This file contains hidden or 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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| 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.12' | |
| - 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/Space ]; 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 | tee test_output.txt | |
| - 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 |