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

Upgrades Ansible and Python versions #470

Merged
merged 1 commit into from
Dec 23, 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
4 changes: 3 additions & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
skips: []
# No need to check for security issues in the test scripts!
exclude_dirs:
# No need to check for security issues in the test scripts!
- "./tests/"
# Ignore locally installed collection
- "./collections/"
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
python-version:
description: "The Python version to use"
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
full-integration:
description: "Run full integration tests"
Expand All @@ -30,8 +30,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -51,12 +51,12 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
nautobot-version:
- "2.3"
ansible-version:
- "2.16"
- "2.17"
- "2.18"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -70,8 +70,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -80,6 +80,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable

jobs:
lint:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand All @@ -15,13 +15,13 @@ jobs:
- name: "Linting"
run: "invoke lint"
unit:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -39,8 +39,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -49,6 +49,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -57,15 +65,15 @@ jobs:
- "unit"
publish_github:
name: "Publish to GitHub"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Build the collection"
Expand All @@ -82,15 +90,15 @@ jobs:
- "integration"
publish_galaxy:
name: "Publish to Ansible Galaxy"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Create the ansible.cfg file"
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version: 2

# Set the version of Python in the build environment.
build:
os: "ubuntu-22.04"
os: "ubuntu-24.04"
tools:
python: "3.10"
python: "3.11"
jobs:
post_install:
- "ansible-galaxy collection install . --force"
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# This base stage just installs the dependencies required for production
# without any development deps.
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
FROM python:${PYTHON_VER} AS base

# Allow for flexible Python versions, for broader testing
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq shellcheck && apt-get clean
Expand Down Expand Up @@ -60,7 +60,7 @@ FROM lint AS unittests
ARG ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
ENV ANSIBLE_COLLECTIONS_PATH=${ANSIBLE_COLLECTIONS_PATH}

ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}

# Allows for custom command line arguments to be passed to ansible-test (like -vvv)
Expand Down Expand Up @@ -89,7 +89,7 @@ RUN ansible-test sanity $ANSIBLE_SANITY_ARGS \
plugins/

# Run unit tests
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --python ${PYTHON_VERSION}
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --requirements --python ${PYTHON_VERSION}

############
# Integration Tests
Expand Down
2 changes: 1 addition & 1 deletion development/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nautobot-bgp-models==0.20.0
nautobot-bgp-models==2.3.0
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
x-args:
&args
PYTHON_VER: ${PYTHON_VER}
ANSIBLE_SANITY_ARGS: ${ANSIBLE_SANITY_ARGS:-}
ANSIBLE_UNIT_ARGS: ${ANSIBLE_UNIT_ARGS:-}
# Build block with context and target default
x-build:
&build
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core==2.15.12
ansible-core==2.18
mkdocs==1.6.1
mkdocs-ansible-collection==0.2.0
mkdocs-material==9.5.30
Expand Down
Loading