Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Black

on: [push, pull_request]

jobs:

lint:
name: Check code format
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
args: ". --check --config=black.cfg"
61 changes: 61 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Documentation

on:
push:
paths:
- "docs/**"
- "AUTHORS.rst"
- "CHANGES.rst"
- "CONTRIBUTING.rst"
- "LICENSE.rst"
- "README.rst"
pull_request:
paths:
- "docs/**"
- "AUTHORS.rst"
- "CHANGES.rst"
- "CONTRIBUTING.rst"
- "LICENSE.rst"
- "README.rst"

jobs:
build:
name: Build documentation
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list

- name: Install dependencies
run: |
conda install mamba
mamba install --file=requirements.txt
pip install -r requirements-docs.txt
pip install -q build
python -m build
pip install *.whl

- name: Build documentation
run: make -C docs clean html
27 changes: 27 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flake8

on: [push, pull_request]

jobs:

lint:
name: Check for lint
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Lint
run: |
pip install flake8
flake8 terrainbento tests
36 changes: 0 additions & 36 deletions .github/workflows/main.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: TestPyPI

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+[ab][0-9]*

env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/'

jobs:
build-and-publish:
name: Build and publish to TestPyPI
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
include:
- os: ubuntu-latest
platform: manylinux
python_versions: 'cp37-cp37m cp38-cp38 cp39-cp39'
- os: macos-latest
platform: macosx
- os: windows-latest
platform: win
exclude:
- os: ubuntu-latest
python-version: 3.7
- os: ubuntu-latest
python-version: 3.9

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list

- name: Install build environment
run: pip install twine wheel numpy cython

- name: Build macosx/win Python wheels
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
run: |
conda install mamba
mamba install --file=requirements.txt
pip install -q build
python -m build

- name: Build source distribution
if: matrix.os == 'ubuntu-latest'
run: |
python setup.py sdist
twine upload --skip-existing dist/*.tar.gz

- name: Build manylinux Python wheels
if: matrix.os == 'ubuntu-latest'
uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2010_x86_64
with:
python-versions: ${{ matrix.python_versions }}
build-requirements: 'cython numpy'

- name: Upload distributions
run: twine upload --skip-existing dist/*-${{ matrix.platform }}*.whl
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PyPI

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- '!*[ab][0-9]*'


env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
include:
- os: ubuntu-latest
platform: manylinux
python_versions: 'cp37-cp37m cp38-cp38 cp39-cp39'
- os: macos-latest
platform: macosx
- os: windows-latest
platform: win
exclude:
- os: ubuntu-latest
python-version: 3.7
- os: ubuntu-latest
python-version: 3.9

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list

- name: Install build environment
run: pip install twine wheel numpy cython

- name: Build macosx/win Python wheels
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
run: |
conda install mamba
mamba install --file=requirements.txt
pip install -q build
python -m build

- name: Build source distribution
if: matrix.os == 'ubuntu-latest'
run: |
python setup.py sdist
twine upload --skip-existing dist/*.tar.gz

- name: Build manylinux Python wheels
if: matrix.os == 'ubuntu-latest'
uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2010_x86_64
with:
python-versions: ${{ matrix.python_versions }}
build-requirements: 'cython numpy'

- name: Upload distributions
run: twine upload --skip-existing dist/*-${{ matrix.platform }}*.whl
60 changes: 60 additions & 0 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Notebooks

on: [push, pull_request]

jobs:
build-and-test:
name: Check notebooks
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list

- name: Install requirements
run: |
conda install mamba
mamba install --file=requirements.txt
mamba list

- name: Build and install package
run: |
pip install -q build
python -m build
pip install *.whl

- name: Install testing dependencies
run: mamba install --file=requirements-testing.txt -c conda-forge

- name: Test jupyter notebooks
run: |
python -c 'import terrainbento; print(terrainbento.__version__)'
pip install -r requirements-notebooks.txt
pytest notebooks --run-notebook -vvv
Loading