Fix formatting and clean up CMakeLists.txt #35
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: | |
| deployments: write | |
| 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: TLSF Allocator Performance Chart | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: '^AllocatorFixture.*' | |
| tool: 'googlecpp' | |
| output-file-path: ${{github.workspace}}/build/bin/benchmark_result.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| gh-pages-branch: 'gh-pages' | |
| auto-push: true | |
| # ONLY RUNS ON UBUNTU: Prevents redundant pushes from the Windows job | |
| if: success() && matrix.os == 'ubuntu-latest' | |
| # 2. System Malloc Performance Chart (The Baseline) | |
| # This step is explicitly filtered to only include tests starting with 'BM_System_Malloc' | |
| - name: System Malloc Performance (Baseline) | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: '^BM_System_Malloc.*' | |
| tool: 'googlecpp' | |
| output-file-path: ${{github.workspace}}/build/bin/benchmark_result.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| gh-pages-branch: 'gh-pages' | |
| auto-push: true | |
| # ONLY RUNS ON UBUNTU: Prevents redundant pushes from the Windows job | |
| if: success() && matrix.os == 'ubuntu-latest' | |