fix linting and updating maintenance guide

Updating the maintainers guide with updated intructions from
Ansible engineers.

Fixing linting issues, and adding the linter as a GitHub workflow
to ensure there are no regressions.
This commit is contained in:
Yusuke Tsutsumi 2022-12-06 22:06:02 -08:00 committed by Yusuke Tsutsumi
commit a9545c77a4
15 changed files with 91 additions and 74 deletions

View file

@ -1,34 +1,35 @@
name: "Run tests for the cloud.google collection"
on: [pull_request]
env:
PYTHON_VERSION: "3.9" # minimum version for Ansible 2.14
jobs:
# sanity tests cannot be turned on until #498 is resolved.
# sanity:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ansible_collections/google/cloud
# strategy:
# matrix:
# ansible_version:
# - stable-2.13
# - stable-2.11
# steps:
# - name: check out code
# uses: actions/checkout@v2
# with:
# path: ansible_collections/google/cloud
# - name: Set up Python
# uses: actions/setup-python@v1
# with:
# python-version: '3.8' # this is the minimum version required for Ansible 2.11
# - name: Install ansible-base (${{ matrix.ansible_version }})
# uses: nick-invision/retry@v2
# with:
# timeout_minutes: 3
# max_attempts: 3
# command: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
# - name: Run sanity tests
# run: ansible-test sanity --docker -v --color --python 3.8
sanity:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible_collections/google/cloud
strategy:
matrix:
ansible_version:
- stable-2.14
steps:
- name: check out code
uses: actions/checkout@v2
with:
path: ansible_collections/google/cloud
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install ansible-base (${{ matrix.ansible_version }})
uses: nick-invision/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
# validate-modules cannot be turned on until #498 is resolved.
run: ansible-test sanity -v --color --python "$PYTHON_VERSION" --skip validate-modules
unit:
runs-on: ubuntu-latest
defaults:
@ -47,7 +48,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.14
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install test dependencies
@ -55,4 +56,4 @@ jobs:
- 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 3.9
run: ansible-test units -v --color --python "$PYTHON_VERSION"