[pre-commit.ci] pre-commit autoupdate #621
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
python: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.10", "3.11"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4.7.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1.12.1 | |
- name: Set up CMake | |
uses: lukka/get-cmake@v3.27.7 | |
- name: Install EGL on Linux for headless Arcade | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update && sudo apt-get install libegl1 | |
- name: Run Tox | |
run: | | |
pip install tox tox-gh-actions | |
tox | |
- name: Upload coverage report | |
uses: coverallsapp/github-action@v2.2.3 | |
with: | |
file: coverage.lcov | |
flag-name: run-python-${{ matrix.os }}-${{ matrix.python-version }} | |
parallel: true | |
cpp: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.1 | |
- name: Set up CMake | |
uses: lukka/get-cmake@v3.27.7 | |
- name: Configure and build CMake | |
working-directory: ${{ github.workspace }}/src/hades_extensions | |
run: | | |
cmake --preset Coverage | |
cmake --build build-coverage | |
- name: Run CTest and generate the coverage report | |
run: | | |
pip install gcovr | |
ctest --output-on-failure --no-tests=error --test-dir ${{ github.workspace }}/src/hades_extensions/build-coverage/tests | |
gcovr -r ${{ github.workspace }} --exclude src/hades_extensions/build-coverage --exclude src/hades_extensions/tests --exclude src/hades_extensions/src/binding.cpp --coveralls coverage.json | |
- name: Upload coverage report | |
uses: coverallsapp/github-action@v2.2.3 | |
with: | |
file: coverage.json | |
flag-name: run-cpp-${{ matrix.os }} | |
parallel: true | |
finish: | |
runs-on: ubuntu-latest | |
needs: [python, cpp] | |
steps: | |
- name: Upload coverage report | |
uses: coverallsapp/github-action@v2.2.3 | |
with: | |
parallel-finished: true |