Skip to content

Commit

Permalink
Added tests and simplified publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Apr 23, 2020
1 parent c04155a commit 37502fa
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ on:
types: [published]

jobs:
publish:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
Expand All @@ -21,17 +22,40 @@ jobs:
uses: dschep/install-poetry-action@v1.3

- name: Set Poetry config
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI"
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Test with pytest
run: poetry run pytest --cov-report term-missing --cov-report=xml --cov=labthings ./tests

publish:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install Poetry
uses: dschep/install-poetry-action@v1.3

- name: Set Poetry config
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
run: |
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI"
- name: Build with Poetry
run: poetry build

Expand Down

0 comments on commit 37502fa

Please sign in to comment.