Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
feat: use pyversion
Browse files Browse the repository at this point in the history
  • Loading branch information
alperenkose committed Oct 2, 2024
1 parent 9c2749f commit cb21254
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
env:
NAMESPACE: paloaltonetworks
COLLECTION_NAME: panos
PYTHON_VERSION: 3.8

jobs:

Expand Down Expand Up @@ -109,9 +108,14 @@ jobs:
cd .github/workflows
python -m tox -- ../..
pyversion:
name: Discover minimum Python version
uses: PaloAltoNetworks/pan-os-upgrade-assurance/.github/actions/[email protected]

format:
name: Code Format Check
runs-on: ubuntu-latest
needs: pyversion
defaults:
run:
working-directory: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
Expand All @@ -123,7 +127,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ needs.pyversion.outputs.pyversion }}

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
Expand Down Expand Up @@ -196,7 +200,7 @@ jobs:
docs:
name: docs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [release]
needs: [release, pyversion]
runs-on: ubuntu-latest

defaults:
Expand All @@ -216,7 +220,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: ${{ needs.pyversion.outputs.pyversion }}

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ jobs:

- name: discover Python version
id: pyversion
shell: bash
run: |
PYVER=$(grep '^[Pp]ython ' pyproject.toml | sed -E 's/python += +\"\^?([0-9]\.[0-9]+)(\.[0-9]+)?\"/\1/; /python/q1')
echo "pyversion=$PYVER" >> $GITHUB_OUTPUT
# uses: PaloAltoNetworks/pan-os-upgrade-assurance/.github/actions/[email protected]
uses: PaloAltoNetworks/pan-os-upgrade-assurance/.github/actions/[email protected]
# shell: bash
# run: |
# PYVER=$(grep '^[Pp]ython ' pyproject.toml | sed -E 's/python += +\"\^?([0-9]\.[0-9]+)(\.[0-9]+)?\"/\1/; /python/q1')
# echo "pyversion=$PYVER" >> $GITHUB_OUTPUT
# working-directory doesn't work with uses, until you get a `with path` similar to checkout, this is going to be inline

- name: install Python
Expand Down

0 comments on commit cb21254

Please sign in to comment.