-
Notifications
You must be signed in to change notification settings - Fork 9
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
61 changed files
with
2,097 additions
and
1,397 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,59 +1,37 @@ | ||
name: Deploy | ||
name: Publish Python distributions to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
bump-version: | ||
name: SemVer Bump | ||
build-n-publish: | ||
name: Build and publish to PyPI | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_version: ${{ steps.bump.outputs.new_version }} | ||
new_tag: ${{ steps.bump.outputs.new_tag }} | ||
previous_tag: ${{ steps.bump.outputs.previous_tag }} | ||
previous_version: ${{ steps.bump.outputs.previous_version }} | ||
release_type: ${{ steps.bump.outputs.release_type }} | ||
changelog: ${{ steps.bump.outputs.changelog }} | ||
|
||
env: | ||
ENV_NAME: publish | ||
PYTHON: 3.8 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Ensure full history is gotten. | ||
- uses: actions/checkout@main | ||
with: | ||
fetch-depth: 0 | ||
- name: Get New Version | ||
id: bump | ||
uses: mathieudutour/[email protected] | ||
with: | ||
default_bump: false | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: bump-version | ||
if: needs.bump-version.outputs.new_version != null | ||
steps: | ||
- uses: actions/checkout@master | ||
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.x | ||
- name: Create setuptools_scm env variable | ||
shell: bash | ||
run: | | ||
version=${{ needs.bump-version.outputs.new_version }} | ||
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$version" >> $GITHUB_ENV | ||
python-version: ${{ env.PYTHON }} | ||
|
||
- name: Install build | ||
run: | | ||
python -m pip install build | ||
python -m pip install setuptools_scm | ||
python setup.py --version | ||
run: pip install build | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: python -m build | ||
- name: Publish distribution 📦 to PyPI | ||
run: | | ||
python -m build | ||
- name: Publish to PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
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,56 @@ | ||
name: Run Demo | ||
on: [push, pull_request] | ||
|
||
|
||
jobs: | ||
tests: | ||
name: Run Demo | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
ENV_NAME: testing | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
demo: ["getting_started", "understanding_21cmsense", "reproducing_pober_2015"] | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
python-version: "3.10" | ||
environment-file: ci/${{ env.ENV_NAME }}.yaml | ||
activate-environment: ${{ env.ENV_NAME }} | ||
|
||
- name: Conda Info | ||
run: | | ||
conda info | ||
python --version | ||
- name: Install Deps | ||
run: | | ||
pip install . | ||
pip install papermill ipykernel | ||
conda list | ||
- name: Install ipykernel | ||
run: python -m ipykernel install --user --name sense --display-name "sense" | ||
|
||
- name: Run Notebook | ||
run: | | ||
papermill -k sense docs/tutorials/${{ matrix.demo }}.ipynb output-${{ matrix.demo }}.ipynb | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: ${{ matrix.demo }} | ||
path: output-${{ matrix.demo }}.ipynb |
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: Warnings Test | ||
on: [pull_request] | ||
|
||
|
||
jobs: | ||
tests: | ||
name: Test With Warnings | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
ENV_NAME: testing | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.10"] | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: ci/${{ env.ENV_NAME }}.yaml | ||
activate-environment: ${{ env.ENV_NAME }} | ||
|
||
- name: Conda Info | ||
run: | | ||
conda info | ||
python --version | ||
- name: Install Test Deps | ||
run: | | ||
pip install .[test] | ||
conda list | ||
- name: Run Tests | ||
run: | | ||
python -m pytest -W error |
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
# mamba-version: "*" | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
python-version: ${{ matrix.python-version }} | ||
|
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
Oops, something went wrong.