Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 Update Continuous Integration #18

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually

jobs:
build:
name: python-${{ matrix.python-version }}
if: github.repository == 'NCAR/intake-thredds'
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -22,6 +19,10 @@ jobs:
matrix:
python-version: ['3.7', '3.8', '3.9']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -31,11 +32,11 @@ jobs:
activate-environment: intake-thredds-dev
auto-update-conda: false
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yml

- name: Set up conda environment
- name: Install intake-thredds
run: |
mamba env update -f ci/environment.yml
python -m pip install .
python -m pip install . --no-deps
conda list

- name: Run Tests
Expand All @@ -54,10 +55,15 @@ jobs:
upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
if: github.repository == 'NCAR/intake-thredds'
defaults:
run:
shell: bash -l {0}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -67,10 +73,10 @@ jobs:
activate-environment: intake-thredds-dev
auto-update-conda: false
python-version: 3.8
- name: Set up conda environment
environment-file: ci/environment-upstream-dev.yml
- name: Install intake-thredds
run: |
mamba env update -f ci/environment-upstream-dev.yml
python -m pip install .
python -m pip install . --no-deps
conda list

- name: Run Tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: linting

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
linting:
Expand Down
59 changes: 49 additions & 10 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
name: Publish intake-thredds to PyPI
name: Upload intake-thredds to PyPI

on:
release:
types:
- published

workflow_dispatch:
jobs:
test-deploy:
if: github.repository == 'NCAR/intake-thredds'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine check-manifest
- name: Build tarball and wheels
run: |
python setup.py sdist bdist_wheel
python -m pip wheel . -w dist --no-deps
- name: Test the artifacts
run: |
python -m twine check dist/*

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.TESTPYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
verbose: true

deploy:
needs: test-deploy
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
python -m pip install setuptools setuptools-scm wheel twine check-manifest
- name: Build tarball and wheels
run: |
python setup.py sdist bdist_wheel
python -m twine upload dist/* --skip-existing
python -m pip wheel . -w dist --no-deps
- name: Test the artifacts
run: |
python -m twine check dist/*

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
skip_existing: true
verbose: true
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -15,7 +15,7 @@ repos:
- id: black

- repo: https://github.com/keewis/blackdoc
rev: v0.3
rev: v0.3.3
hooks:
- id: blackdoc

Expand All @@ -29,17 +29,17 @@ repos:
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.6.4
rev: v5.7.0
hooks:
- id: isort

- repo: https://github.com/prettier/pre-commit
rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier

- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.3
rev: 0.5.7
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
Expand Down