-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
43 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,32 @@ | ||
name: Run unit tests | ||
name: Test the library | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: | ||
- master | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] | ||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
||
name: Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache: "pip" | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
DEPENDENCIES=$(python -c 'from setuptools.config.setupcfg import read_configuration as c; a = c("setup.cfg"); print(" ".join(a["options"]["install_requires"][1:] + a["options"]["extras_require"]["testing"][1:]))') | ||
pip install ${DEPENDENCIES} pybind11 | ||
- name: Get latest CMake | ||
uses: lukka/get-cmake@latest | ||
|
||
# We do proper tests if we're on the master branch, or if we're creating a new release. | ||
- name: Test with tox | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
pip install tox | ||
tox | ||
# Otherwise we do some cached builds and tests for faster merging of PRs. | ||
- name: Set up ccache | ||
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') | ||
uses: hendrikmuhs/[email protected] | ||
|
||
- name: Quickly build and test | ||
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') | ||
run: | | ||
CC="ccache gcc" python setup.py install | ||
pytest |