DAG-2764 Update github actions ubuntu version. #51
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-22.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://install.python-poetry.org | python3 - | |
export PATH="$HOME/.local/bin:$PATH" | |
poetry install | |
- name: Test | |
run: | | |
export PATH="$HOME/.local/bin:$PATH" | |
poetry run pytest --runslow | |
deploy: | |
needs: test | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-22.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 }} | |