Skip to content

Commit

Permalink
move Python version specification to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreatma committed Oct 1, 2024
1 parent 3834f1a commit 6755539
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 34 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ansible-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
- name: install make
run: sudo apt-get install -y build-essential

- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: checkout Python SDK, this PR
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: setup python 3
uses: actions/setup-python@v5
with:
python-version-file: .python-version

- name: checkout Ansible collection
uses: actions/checkout@v4
with:
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version

- name: Install dependencies
working-directory: ${{ env.PACKAGE_DIR }}
run: |
python -m pip install --upgrade build
- name: Install pyaml for patching script
working-directory: ${{ env.PACKAGE_DIR }}
run: |
python -m pip install pyaml
- name: Create GitHub release
uses: cycjimmy/semantic-release-action@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync-fabricv4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: GitHub user
run: |
# https://api.github.com/users/github-actions[bot]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync-metalv1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: GitHub user
run: |
# https://api.github.com/users/github-actions[bot]
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test-codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install pyaml for patching script
working-directory: ${{ env.PACKAGE_DIR }}
python-version-file: .python-version

- name: Install pyaml for Metal patching script
run: |
python -m pip install pyaml
- name: Checkout code
uses: actions/checkout@v4
- name: Verify Patches
run: make patch-all

- name: Generate
run: |
make generate-all
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ coverage.xml
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
8 changes: 4 additions & 4 deletions templates/.github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: GitHub user
run: |
# https://api.github.com/users/github-actions[bot]
Expand Down

0 comments on commit 6755539

Please sign in to comment.