-
Notifications
You must be signed in to change notification settings - Fork 10
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
5 changed files
with
148 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and test [Python 3.9, 3.10] | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda using Python ${{ matrix.python-version }} | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
auto-update-conda: true | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: false | ||
|
||
- name: Build | ||
shell: bash -l {0} | ||
run: | | ||
pip install -e . | ||
pip install pytest-cov | ||
pip install pytest-pycodestyle | ||
- name: Test | ||
shell: bash -l {0} | ||
working-directory: ./ | ||
run: | | ||
pytest -m 'not local' --cov=./ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true |
6 changes: 3 additions & 3 deletions
6
.github/workflows/check_black.yml → .github/workflows/check_format.yml
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Deploy Jupyter Book documentation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-deploy: | ||
if: github.repository == 'EAPD-DRB/OG-ZAF' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: "3.10" | ||
auto-activate-base: false | ||
|
||
- name: Build # Build Jupyter Book | ||
shell: bash -l {0} | ||
run: | | ||
pip install jupyter-book>=0.11.3 | ||
pip install sphinxcontrib-bibtex>=2.0.0 | ||
pip install -e . | ||
python -m ipykernel install --user --name=ogzaf-dev | ||
jb build ./docs/book | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: docs/book/_build/html # The folder the action should deploy. |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check that docs build | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: "3.10" | ||
auto-activate-base: false | ||
|
||
- name: Build # Build Jupyter Book | ||
shell: bash -l {0} | ||
run: | | ||
pip install jupyter-book>=0.11.3 | ||
pip install sphinxcontrib-bibtex>=2.0.0 | ||
pip install -e . | ||
python -m ipykernel install --user --name=ogzaf-dev | ||
jb build ./docs/book |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish package to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: Publish to PyPI | ||
if: github.repository == 'EAPD-DRB/OG-ZAF' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Build package | ||
shell: bash -l {0} | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI }} | ||
skip_existing: true |