add C++ test github action #196
Workflow file for this run
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: Python test linux | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.11"] | |
os: ["ubuntu-22.04"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
key: pybmds-${{ runner.os }}-${{ matrix.python-version }} | |
- name: Install dependencies and build pybmds | |
run: | | |
source ./tools/linux_ci.sh | |
python -m pip install -U pip wheel | |
python -m pip install -e ".[dev,docs]" | |
stubgen -p pybmds.bmdscore -o src | |
ruff format src/pybmds/bmdscore.pyi | |
- name: Check linked files | |
run: | | |
ls -lah src/pybmds | |
ldd src/pybmds/bmdscore*.so | |
- name: loc | |
run: | | |
sudo apt-get install -y cloc | |
echo "# Lines of Code Report" >> $GITHUB_STEP_SUMMARY | |
make loc >> $GITHUB_STEP_SUMMARY | |
- name: Check linting | |
run: | | |
make lint | |
- name: Test with pytest | |
run: | | |
coverage run -m pytest | |
echo "# Python coverage report" >> $GITHUB_STEP_SUMMARY | |
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY | |
- name: Build documentation | |
run: | | |
make docs | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
./docs/build/html | |
./dist/*.whl |