DAG-2764 Update dockerfile for publish. #63
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
name: Test and Publish Python Package | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-18.04 | |
strategy: | |
matrix: | |
python-version: [3.8] | |
name: Run Tests/Linters | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install | |
run: | | |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | |
source $HOME/.poetry/env | |
poetry install | |
- name: Test | |
run: | | |
source $HOME/.poetry/env | |
poetry run pytest --runslow | |
deploy: | |
needs: test | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-18.04 | |
name: Publish Package | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build and Publish Python Package | |
uses: ./ # Use action in the root directory. | |
id: publish | |
with: | |
pypi-username: ${{ secrets.PYPI_USERNAME }} | |
pypi-password: ${{ secrets.PYPI_PASSWORD }} | |