Add method to run job and wait for result #569
Workflow file for this run
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: "CI" | |
on: # yamllint disable | |
- "push" | |
- "pull_request" | |
jobs: | |
tests: | |
runs-on: "ubuntu-20.04" | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
nautobot-version: ["2.0", "2.1", "2.2", "stable"] | |
env: | |
PYTHON_VER: "${{ matrix.python-version }}" | |
NAUTOBOT_VER: "${{ matrix.nautobot-version }}" | |
steps: | |
- name: "Check out repository code" | |
uses: "actions/checkout@v4" | |
- name: "Setup environment" | |
uses: "networktocode/gh-action-setup-poetry-environment@v6" | |
- name: "Set up Docker Buildx" | |
id: "buildx" | |
uses: "docker/setup-buildx-action@v3" | |
- name: "Tests" | |
run: "poetry run invoke tests" | |
publish_pypi: | |
name: "Push Package to PyPI" | |
runs-on: "ubuntu-20.04" | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- name: "Check out repository code" | |
uses: "actions/checkout@v4" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.9" | |
- name: "Install Python Packages" | |
run: "pip install poetry" | |
- name: "Set env" | |
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV" | |
- name: "Run Poetry Version" | |
run: "poetry version $RELEASE_VERSION" | |
- name: "Run Poetry Build" | |
run: "poetry build" | |
- name: "Push to PyPI" | |
uses: "pypa/gh-action-pypi-publish@release/v1" | |
with: | |
user: "__token__" | |
password: "${{ secrets.PYPI_API_TOKEN }}" | |
needs: | |
- "tests" |