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: update CI configuration #15

Merged
merged 3 commits into from
Sep 11, 2023
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
7 changes: 3 additions & 4 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ name: Build and release new version
on:
push:
tags:
- 'v*'
- "v*"

env:
NAMESPACE: community
COLLECTION_NAME: upcloud
ANSIBLE_VERSION: stable-2.11
ANSIBLE_VERSION: stable-2.15

jobs:

units:
runs-on: ubuntu-latest
name: Build and release
Expand All @@ -22,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.11

- name: Install ansible-base (${{env.ANSIBLE_VERSION}})
run: pip install https://github.com/ansible/ansible/archive/${{env.ANSIBLE_VERSION}}.tar.gz --disable-pip-version-check
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/sanity-test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: sanity
on:
- push
- pull_request
push:
branches:
- main
pull_request:
env:
NAMESPACE: community
COLLECTION_NAME: upcloud

jobs:
sanity:
name: Sanity test (${{ matrix.ansible }})
name: Sanity test (${{ matrix.version.ansible }})
strategy:
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- devel
version:
- { ansible: stable-2.13, python: "3.10" }
- { ansible: stable-2.14, python: "3.11" }
- { ansible: stable-2.15, python: "3.11" }
- { ansible: devel, python: "3.11" }
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v1
with:
Expand All @@ -27,13 +28,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: ${{ matrix.version.python }}

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install ansible-base (${{ matrix.version.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.version.ansible }}.tar.gz --disable-pip-version-check

- name: Run sanity tests
run: ansible-test sanity --docker -v --color

- name: Test building a release
run: ansible-galaxy collection build
run: ansible-galaxy collection build
25 changes: 13 additions & 12 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
name: unit
on:
- push
- pull_request
push:
branches:
- main
pull_request:

env:
NAMESPACE: community
COLLECTION_NAME: upcloud

jobs:

units:
runs-on: ubuntu-latest
name: Unit tests (${{ matrix.ansible }})
name: Unit tests (${{ matrix.version.ansible }})
strategy:
fail-fast: true
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- devel
version:
- { ansible: stable-2.13, python: "3.10" }
- { ansible: stable-2.14, python: "3.11" }
- { ansible: stable-2.15, python: "3.11" }
- { ansible: devel, python: "3.11" }

steps:
- name: Check out code
Expand All @@ -32,10 +33,10 @@ jobs:
with:
# it is just required to run that once as "ansible-test units" in the docker image
# will run on all python versions it supports.
python-version: 3.8
python-version: ${{ matrix.version.python }}

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install ansible-base (${{ matrix.version.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.version.ansible }}.tar.gz --disable-pip-version-check

# Run the unit tests
- name: Run unit test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json

# ansible-test
tests/output/
5 changes: 3 additions & 2 deletions plugins/inventory/upcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

DOCUMENTATION = r'''
name: upcloud
plugin_type: inventory
author:
- Antti Myyrä (@ajmyyra)
short_description: Ansible dynamic inventory plugin for UpCloud.
Expand Down Expand Up @@ -48,16 +47,19 @@
description: Populate inventory with instances in these zones.
default: []
type: list
elements: str
required: false
tags:
description: Populate inventory with instances with these tags.
default: []
type: list
elements: str
required: false
states:
description: Populate inventory with instances with these states.
default: []
type: list
elements: str
required: false
network:
description: Populate inventory with instances which are attached to this network name or UUID.
Expand Down Expand Up @@ -97,7 +99,6 @@

try:
import upcloud_api
from upcloud_api import Server
from upcloud_api.errors import UpCloudAPIError
UC_AVAILABLE = True
except ImportError:
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.10.txt

This file was deleted.

2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.11.txt

This file was deleted.

1 change: 1 addition & 0 deletions tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/inventory/upcloud.py validate-modules:missing-gplv3-license
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/inventory/upcloud.py validate-modules:missing-gplv3-license
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/inventory/upcloud.py validate-modules:missing-gplv3-license
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/inventory/upcloud.py validate-modules:missing-gplv3-license
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.9.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/unit/plugins/inventory/test_upcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest

from ansible.errors import AnsibleParserError
from ansible.inventory.data import InventoryData
from .....plugins.inventory.upcloud import InventoryModule

Expand Down
Loading