ci: add a workflow to run unit tests #6
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: Unit tests | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential | |
| - name: Configure CMake | |
| run: | | |
| cmake -Bbuild -DTEST_ENABLED=ON -DSAMPLE_ENABLED=ON . | |
| - name: Build project | |
| run: | | |
| cmake --build build | |
| - name: Run unit tests | |
| run: | | |
| ./build/tests/uprof-tests --reporter JUnit::out=test-results.xml --reporter console::out=-::colour-mode=ansi --success | |
| - name: Upload JUnit report | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "test-results.xml" | |
| output: test-summary.md | |
| if: always() | |
| - name: Upload test summary | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-summary | |
| path: test-summary.md | |
| if: always() |