Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 14 additions & 11 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 @@ -18,18 +19,20 @@ jobs:
run:
working-directory: ansible_collections/google/cloud
strategy:
max-parallel: 1
matrix:
ansible_version:
- stable-2.13
- stable-2.14
- stable-2.15
steps:
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
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.15
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install ansible-base (${{ matrix.ansible_version }})
Expand All @@ -53,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
22 changes: 12 additions & 10 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
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
PYTHON_VERSION: "3.9" # minimum version for Ansible 2.15
jobs:
sanity-and-lint:
runs-on: ubuntu-latest
Expand All @@ -12,13 +13,14 @@ jobs:
matrix:
ansible_version:
- stable-2.14
- stable-2.15
steps:
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
# Automation-hub requires python2.7 sanity tests
Expand All @@ -36,7 +38,7 @@ jobs:
# validate-modules cannot be turned on until #498 is resolved.
run: ansible-test sanity -v --color --skip validate-modules
- name: Install ansible-lint
run: pip install ansible-lint==6.13.1
run: pip install ansible-lint==6.22.0
- name: Run ansible-lint
run: ansible-lint
unit:
Expand All @@ -48,21 +50,21 @@ jobs:
matrix:
ansible_version:
- stable-2.14
- stable-2.11
- stable-2.15
steps:
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
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"
6 changes: 3 additions & 3 deletions .github/workflows/automationhub.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: Upload release to Automation Hub

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/gcloud.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
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
runs-on: ubuntu-latest
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
Expand All @@ -26,12 +27,12 @@ jobs:
- gcloud
steps:
- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud

- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9

Expand All @@ -47,9 +48,10 @@ jobs:
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
python -m pip install --upgrade pip
pip install molecule[docker] yamllint ansible ansible-lint docker
pip install molecule-plugins[docker] yamllint ansible ansible-lint docker

- name: Run role test
working-directory: ansible_collections/google/cloud
run: >-
molecule --version &&
ansible --version &&
Expand Down
12 changes: 7 additions & 5 deletions .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 All @@ -10,7 +11,7 @@ on:
- .github/workflows/gcsfuse.yml
jobs:
gcsfuse:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
Expand All @@ -21,12 +22,12 @@ jobs:
- gcsfuse
steps:
- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
path: ansible_collections/google/cloud

- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9

Expand All @@ -42,9 +43,10 @@ jobs:
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
python -m pip install --upgrade pip
pip install molecule[docker] yamllint ansible ansible-lint docker
pip install molecule-plugins[docker] yamllint ansible ansible-lint docker

- name: Run role test
working-directory: ansible_collections/google/cloud
run: >-
molecule --version &&
ansible --version &&
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: Upload release to Galaxy

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -124,10 +124,10 @@ Run `ansible-test integration`. Currently some tests are disabled as [test are b
### Prequisites for role tests

If you would like to use podman, you must
install the `molecule[podman]` package in PyPI:
install the `molecule-plugins[podman]` package in PyPI:

```
pip install --upgrade molecule[podman]
pip install --upgrade molecule-plugins[podman]
```

### Running role tests
Expand Down
Loading