EXAMPLE: additional example notebooks #10
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
on: | |
push: | |
branches: | |
- main | |
- release/** | |
pull_request: | |
branches: | |
- main | |
- release/** | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup conda | |
uses: s-weigand/setup-conda@v1 | |
with: | |
update-conda: true | |
python-version: ${{ matrix.python-version }} | |
conda-channels: anaconda, conda-forge | |
- name: Install dependencies | |
run: | | |
conda install pip setuptools pre-commit | |
conda install jax numpy scipy astropy gwpopulation pytest-cov | |
pre-commit install | |
- name: Install gwpopulation | |
run: | | |
pip install .[test] | |
- name: List installed | |
run: | | |
conda list | |
- name: Run pre-commit checks | |
run: | | |
pre-commit run --all-files --verbose --show-diff-on-failure | |
- name: Test with pytest | |
run: | | |
pytest --cov wcosmo -ra --color yes --cov-report=xml --junitxml=pytest.xml | |
- name: Publish coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: python${{ matrix.python-version }} | |
- name: Coverage report | |
run: python -m coverage report --show-missing | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-${{ matrix.python-version }} | |
path: pytest.xml |