Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): move Python version into a file #230

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/docs-generation-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ permissions:
pull-requests: read
contents: read

env:
COLLECTION_PATH: .ansible/collections/ansible_collections/equinix/cloud

jobs:
integration-test-pr:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .ansible/collections/ansible_collections/equinix/cloud
working-directory: ${{ env.COLLECTION_PATH }}
steps:
- uses: actions/checkout@v4
with:
path: .ansible/collections/ansible_collections/equinix/cloud
path: ${{ env.COLLECTION_PATH }}
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: update packages
Expand All @@ -33,7 +36,7 @@ jobs:
- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version-file: ${{ env.COLLECTION_PATH }}/.python-version

- name: install dependencies
run: pip3 install -r requirements-dev.txt -r requirements.txt
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ permissions:
pull-requests: read
contents: read

env:
COLLECTION_PATH: .ansible/collections/ansible_collections/equinix/cloud

jobs:
authorize:
environment:
Expand All @@ -41,11 +44,11 @@ jobs:
concurrency: 'e2e-test'
defaults:
run:
working-directory: .ansible/collections/ansible_collections/equinix/cloud
working-directory: ${{ env.COLLECTION_PATH }}
steps:
- uses: actions/checkout@v4
with:
path: .ansible/collections/ansible_collections/equinix/cloud
path: ${{ env.COLLECTION_PATH }}
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: update packages
Expand All @@ -57,7 +60,7 @@ jobs:
- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version-file: ${{ env.COLLECTION_PATH }}/.python-version

- name: install dependencies
run: pip3 install -r requirements-dev.txt -r requirements.txt
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ name: Semantic Release to GitHub and Ansible Galaxy
on:
workflow_dispatch: null

env:
COLLECTION_PATH: .ansible/collections/ansible_collections/equinix/cloud


jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -15,7 +19,7 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4
with:
path: .ansible/collections/ansible_collections/equinix/cloud
path: ${{ env.COLLECTION_PATH }}
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

Expand All @@ -28,15 +32,15 @@ jobs:
- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version-file: ${{ env.COLLECTION_PATH }}/.python-version

- name: install dependencies
run: pip3 install -r requirements-dev.txt -r requirements.txt

- name: Do GitHub release
uses: cycjimmy/semantic-release-action@v4
with:
working_directory: .ansible/collections/ansible_collections/equinix/cloud
working_directory: ${{ env.COLLECTION_PATH }}
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/[email protected]
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ flycheck_*.el
# network security
/network-security.data


### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
Expand Down Expand Up @@ -245,9 +244,6 @@ docs/_build/
# PyBuilder
target/

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
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
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## 0. <a name="Developmentenvironmentsetup"></a>Development environment setup

We use Python 3.8 for the collection development.
We use Python for collection development. The Python version that is currently used in GitHub Actions workflows is tracked in the `.python-version` file in the root of this repository. We recommend using the same Python version for local development. Some tools, such as `pyenv`, may reference the `.python-version` file automatically, but in other cases you may have to manually install the specified Python version and add it to your path.

Development of the collection is best done if your repository is located in a path that concludes with `ansible_collections/equinix/cloud`. This is a requirement specific to Ansible. You can clone the repository using the following command:

Expand Down