Fix syntax error in CI workflow configuration #29
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: CI Build and Test | |
| on: | |
| push: | |
| branches: "benchmark" #[ "main" ] | |
| jobs: | |
| build_and_test: | |
| # Use a build matrix to test on Linux and Windows | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| # Using a unique build directory path for clean separation | |
| run: cmake -B ${{github.workspace}}/build | |
| - name: Build Project | |
| run: cmake --build ${{github.workspace}}/build --config Release | |
| - name: Run Unit Tests via CTest | |
| run: | | |
| if [ "${{ runner.os }}" == "Windows" ]; then | |
| ctest -C Release --output-on-failure --verbose | |
| else | |
| ctest --output-on-failure --verbose | |
| fi | |
| shell: bash | |
| working-directory: build | |
| - name: Run Benchmarks and Save Results | |
| working-directory: ${{github.workspace}}/build/bin | |
| run: | | |
| if [ "${{ runner.os }}" == "Windows" ]; then | |
| ./Release/benchmark-app.exe --benchmark_format=json --benchmark_out=benchmark_result.json | |
| else | |
| ./benchmark-app --benchmark_format=json --benchmark_out=benchmark_result.json | |
| fi | |
| shell: bash | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| tool: 'googlecpp' | |
| output-file-path: ${{github.workspace}}/build/bin/benchmark_result.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| gh-pages-branch: 'gh-pages' |