Skip to content

Commit

Permalink
Merge pull request #24 from openscm/znicholls-patch-1
Browse files Browse the repository at this point in the history
Update ci-cd-workflow.yml
  • Loading branch information
znicholls authored Apr 20, 2021
2 parents bdc1611 + cd396f1 commit 18aa4ac
Showing 1 changed file with 9 additions and 58 deletions.
67 changes: 9 additions & 58 deletions .github/workflows/ci-cd-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: OpenSCM-Units CI-CD
on: [push,pull_request]
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:

jobs:
linting-and-docs:
Expand Down Expand Up @@ -44,8 +50,6 @@ jobs:
fi
build:
needs: linting-and-docs

runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -79,7 +83,6 @@ jobs:
file: ./coverage.xml

test-notebooks:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -104,61 +107,9 @@ jobs:
run: |
pytest notebooks -r a --nbval --sanitize-with tests/notebook-tests.cfg --no-cov
deploy-test-pypi:
needs: test-notebooks
if: startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[dev]
- name: Create package
run: python setup.py sdist bdist_wheel --universal
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/

test-pypi-install:
needs: deploy-test-pypi

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install package from test PyPI
run: |
pip install --upgrade pip
pip install pandas pint
pip install -i https://testpypi.python.org/pypi openscm-units --no-dependencies --pre
- name: Test installation
run: |
python -c "import sys; sys.path.remove(''); import openscm_units; print(openscm_units.__version__)"
deploy-pypi:
needs: test-pypi-install

needs: [linting-and-docs,build,test-notebooks]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down

0 comments on commit 18aa4ac

Please sign in to comment.