Skip to content

Commit

Permalink
fix: upgrade ansible version, address test and lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SirGitsalot committed Nov 18, 2023
1 parent c15b472 commit 08ada53
Show file tree
Hide file tree
Showing 216 changed files with 4,394 additions and 4,262 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ansible-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: "Run integration tests for the cloud.google collection"
---
name: Run integration tests for the cloud.google collection
on:
pull_request: {}
push:
branches: master
env:
GCP_SERVICE_ACCOUNT: "[email protected]"
GCP_PROJECT: "ansible-gcp-ci"
GCP_SERVICE_ACCOUNT: [email protected]
GCP_PROJECT: ansible-gcp-ci
GCP_FOLDER_ID: "542027184392"
jobs:
integration:
Expand All @@ -31,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.9' # this is the minimum version required for Ansible 2.13
python-version: "3.9" # this is the minimum version required for Ansible 2.13
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install ansible-base (${{ matrix.ansible_version }})
Expand All @@ -55,15 +56,15 @@ jobs:
env:
CI_SERVICE_ACCOUNT_FILE_CONTENTS: ${{ secrets.CI_SERVICE_ACCOUNT_FILE_CONTENTS }}
with:
service_account: "$GCP_SERVICE_ACCOUNT"
credentials_json: "${{ secrets.CI_SERVICE_ACCOUNT_FILE_CONTENTS }}"
service_account: $GCP_SERVICE_ACCOUNT
credentials_json: ${{ secrets.CI_SERVICE_ACCOUNT_FILE_CONTENTS }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Run cleanup
run: |
run: |
./scripts/bootstrap-project.sh $GCP_PROJECT $GCP_SERVICE_ACCOUNT
./scripts/cleanup-project.sh $GCP_PROJECT $GCP_FOLDER_ID
# run tests
- name: Run integration tests
# Add the -vvv flag to print out more output
run: ansible-test integration -v --color --python 3.9 --venv-system-site-packages
run: ansible-test integration -v --color --python 3.9 --venv-system-site-packages
7 changes: 4 additions & 3 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "Run tests for the cloud.google collection"
---
name: Run tests for the cloud.google collection
on: [pull_request]
env:
PYTHON_VERSION: "3.9" # minimum version for Ansible 2.14
Expand Down Expand Up @@ -58,12 +59,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "${{ env.PYTHON_VERSION }}"
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install test dependencies
run: pip install -r requirements-test.txt
- name: Install ansible-base (${{ matrix.ansible_version }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
- name: Run unit tests
run: ansible-test units -v --color --python "$PYTHON_VERSION"
run: ansible-test units -v --color --python "$PYTHON_VERSION"
32 changes: 16 additions & 16 deletions .github/workflows/automationhub.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
name: Upload release to Automation Hub

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Build and publish
env:
ANSIBLE_AUTOMATION_HUB_API_KEY: ${{ secrets.ANSIBLE_AUTOMATION_HUB_API_KEY }}
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish *.tar.gz --api-key=$ANSIBLE_AUTOMATION_HUB_API_KEY -s=https://cloud.redhat.com/api/automation-hub/
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Build and publish
env:
ANSIBLE_AUTOMATION_HUB_API_KEY: ${{ secrets.ANSIBLE_AUTOMATION_HUB_API_KEY }}
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish *.tar.gz --api-key=$ANSIBLE_AUTOMATION_HUB_API_KEY -s=https://cloud.redhat.com/api/automation-hub/
15 changes: 8 additions & 7 deletions .github/workflows/gcloud.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: "google.cloud.gcloud"
---
name: google.cloud.gcloud
on:
push:
paths:
- 'roles/gcloud/**'
- '.github/workflows/gcloud.yml'
- 'molecule/gcloud/**'
- roles/gcloud/**
- .github/workflows/gcloud.yml
- molecule/gcloud/**
pull_request:
paths:
- 'roles/gcloud/**'
- '.github/workflows/gcloud.yml'
- 'molecule/gcloud/**'
- roles/gcloud/**
- .github/workflows/gcloud.yml
- molecule/gcloud/**
jobs:
molecule:
runs-on: ubuntu-18.04
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/gcsfuse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "google.cloud.gcsfuse"
---
name: google.cloud.gcsfuse
on:
push:
paths:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
name: Upload release to Galaxy

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Build and publish
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Build and publish
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
run: |
ansible-galaxy collection build .
ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ git clone <url> $TARGET_DIR/ansible_collections/google/cloud
Then set up your Python virtual environment:

```shell
cd $TARGET_DIR/ansible_collections/google
cd $TARGET_DIR/ansible_collections/google/cloud
python3 -m venv venv
. ./venv/bin/activate
pip3 install -r requirements.txt
Expand Down
Loading

0 comments on commit 08ada53

Please sign in to comment.