Merge pull request #47 from routeviews/python-client-workflow-updates #33
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: python-client | |
on: | |
push: | |
paths: | |
- 'python-client/**' | |
- '.github/workflows/python-client.yml' | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'python-client/**' | |
- '.github/workflows/python-client.yml' | |
jobs: | |
test-and-deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
defaults: | |
run: | |
shell: bash | |
working-directory: python-client | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install pinned dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Install | |
run: | | |
pip install -e . | |
- name: Install plugin that annotates test results | |
run: pip install pytest-github-actions-annotate-failures | |
- name: Test | |
run: | | |
pytest | |
- name: Package 📦 | |
if: github.ref == 'refs/heads/main' | |
run: | | |
python setup.py sdist | |
# This job requires access to the UO NTS Jenkins server. | |
# If we want to publish to pypi, we'll need to find an | |
# alternate build server. | |
# | |
# - name: Publish 📦 to PyPI | |
# if: github.ref == 'refs/heads/main' | |
# uses: pypa/gh-action-pypi-publish@release/v1.5 | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.NTSJENKINS_PYPI }} | |
# packages_dir: python-client/dist |