Merge pull request #188 from nus-cs3203/add-more-tests #1
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: CI for Cmake Project | |
on: | |
push: | |
branches: | |
- master | |
- milestone-* | |
pull_request: | |
branches: | |
- '**' #run for all branches | |
# If you are doing triggering your workflow from pushes or merging more than twice a day on average, | |
# please execute your workflow on a schedule instead. | |
# Comment the above 7 lines, and uncomment the following 3 lines | |
# on: | |
# schedule: | |
# - cron: "0 09,23 * * *" | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Project | |
shell: powershell | |
run: | | |
cd .\Team16\Code16\ | |
mkdir build | |
cd .\build\ | |
cmake .. | |
cmake --build . --target unit_testing --config Release | |
cmake --build . --target integration_testing --config Release | |
cmake --build . --target autotester --config Release | |
cd ..\..\.. | |
- name: Run Unit Tests | |
shell: powershell | |
run: | | |
cd .\Team16\Code16\build\src\ | |
.\unit_testing\Release\unit_testing.exe | |
cd ..\..\..\.. | |
- name: Run Integration Tests | |
shell: powershell | |
run: | | |
cd .\Team16\Code16\build\src\ | |
.\integration_testing\Release\integration_testing.exe | |
cd ..\..\..\.. | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Run System Tests | |
shell: powershell | |
run: | | |
cd .\Team16\Tests16\ | |
python run_autotester.py | |
cd ..\.. | |
build-macos: | |
runs-on: macOS-latest | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Project | |
run: | | |
cd ./Team16/Code16/ | |
mkdir build | |
cd ./build/ | |
cmake .. | |
cmake --build . --target unit_testing --config Release | |
cmake --build . --target integration_testing --config Release | |
cmake --build . --target autotester --config Release | |
cd ../../ | |
- name: Run Unit Tests | |
run: | | |
cd ./Team16/Code16/build/src/ | |
./unit_testing/unit_testing | |
cd ../../../.. | |
- name: Run Integration Tests | |
run: | | |
cd ./Team16/Code16/build/src/ | |
./integration_testing/integration_testing | |
cd ../../../.. | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Run System Tests | |
run: | | |
cd ./Team16/Tests16/ | |
python run_autotester.py | |
cd ../.. |