Test extras #27
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: pytest-all | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- development | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'pyproject.toml' | |
- name: Install pynucastro + pytest | |
run: | | |
python -m pip install --upgrade pip | |
pip install --editable .[test] | |
- name: Print system info | |
run: | | |
pip install threadpoolctl &>/dev/null | |
python -c "import sys, numpy; print(numpy.__version__); print(sys.version); print(numpy.show_runtime())" | |
echo | |
lscpu | |
- name: Run tests with pytest | |
run: pytest -v -s --nbval --cov=pynucastro | |
- name: Upload output from failed write_network tests | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: failed_networks_${{ matrix.python-version }} | |
path: _test_*/ | |
if-no-files-found: ignore | |
retention-days: 5 |