Skip to content

Commit

Permalink
Release 5.0.0 (#254)
Browse files Browse the repository at this point in the history
* Updates collection for compatibility with Nautobot 2.0

* Release 5.0.0 (#253)

* Prepare for release 5.0.0

Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Wesch <joe.wesch@networktocode.com>
Co-authored-by: Josh VanDeraa <jv@networktocode.com>
Co-authored-by: Noah Robin <noahr@nvidia.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
  • Loading branch information
6 people committed Oct 2, 2023
1 parent 8ee04ff commit a45222b
Show file tree
Hide file tree
Showing 237 changed files with 10,794 additions and 12,835 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: "Integration Tests"
on: # yamllint disable
workflow_call:
inputs:
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
type: string
python-version:
description: "The Python version to use"
required: true
type: string
nautobot-version:
description: "The Nautobot version to use"
required: true
type: string
ansible-version:
description: "The Ansible version to use"
required: true
type: string

jobs:
integration:
runs-on: "${{ inputs.runs-on }}"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ inputs.python-version }}"
INVOKE_NAUTOBOT_ANSIBLE_NAUTOBOT_VER: "${{ inputs.nautobot-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v3"
with:
python-version: "${{ inputs.python-version }}"
- name: "Install invoke"
run: "pip install -U pip && pip install invoke"
- name: "Install poetry"
run: "curl -sSL https://install.python-poetry.org | python3 -"
- name: "Install ansible-core"
# This ensures that even if the poetry.lock file updates we still test the right version
run: "poetry add ansible-core@~${{ inputs.ansible-version }}"
- name: "Start containers"
run: "invoke start"
- name: "Tests"
run: "invoke integration"
145 changes: 0 additions & 145 deletions .github/workflows/jobs.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
name: "Tests"
on: # yamllint disable
workflow_call:
inputs:
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
type: string
full-integration:
description: "Run full integration tests"
required: false
default: false
type: boolean

jobs:
lint:
runs-on: "${{ inputs.runs-on }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Install invoke"
run: "pip install -U pip && pip install invoke"
- name: "Linting"
run: "invoke lint"
unit:
runs-on: "${{ inputs.runs-on }}"
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Install invoke"
run: "pip install -U pip && pip install invoke"
- name: "Tests"
run: "invoke unit"
needs:
- "lint"
integration_partial:
# Only run a subset of integration tests on normal PRs
if: ${{ inputs.full-integration == false }}
uses: ./.github/workflows/integration_tests.yml
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
nautobot-version:
- "2.0.0"
ansible-version:
- "2.14"
- "2.15"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
ansible-version: "${{ matrix.ansible-version }}"
needs:
- "unit"
integration_full:
if: ${{ inputs.full-integration == true }}
uses: ./.github/workflows/integration_tests.yml
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
nautobot-version:
- "2.0.0"
ansible-version:
- "2.14"
- "2.15"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
ansible-version: "${{ matrix.ansible-version }}"
needs:
- "unit"
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
---
name: "CI"
name: "Pull Requests (main)"
concurrency: # Cancel any existing runs of this workflow for this same PR
group: "${{ '{{ github.workflow }}' }}-${{ '{{ github.ref }}' }}"
cancel-in-progress: true
on: # yamllint disable
push:
pull_request:
branches:
- "develop"
- "main"
pull_request:
release:
types: [published]

jobs:
ci:
uses: ./.github/workflows/jobs.yml
tests:
uses: ./.github/workflows/tests.yml
with:
full-integration: true
15 changes: 15 additions & 0 deletions .github/workflows/trigger_pr_normal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "Pull Requests (normal)"
concurrency: # Cancel any existing runs of this workflow for this same PR
group: "${{ '{{ github.workflow }}' }}-${{ '{{ github.ref }}' }}"
cancel-in-progress: true
on: # yamllint disable
pull_request:
branches-ignore:
- "main"

jobs:
tests:
uses: ./.github/workflows/tests.yml
with:
full-integration: false
55 changes: 55 additions & 0 deletions .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: "Release"
on: # yamllint disable
release:
types: [published]

jobs:
tests:
uses: ./.github/workflows/tests.yml
with:
full-integration: true
publish_github:
name: "Publish to GitHub"
runs-on: "${{ inputs.runs-on }}"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v3"
with:
python-version: "3.9"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Build the collection"
run: "ansible-galaxy collection build --output-path build"
- name: "Upload binaries to release"
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: "${{ secrets.GH_NAUTOBOT_BOT_TOKEN }}"
file: "build/*"
tag: "${{ github.ref }}"
overwrite: true
file_glob: true
needs:
- "tests"
publish_galaxy:
name: "Publish to Ansible Galaxy"
runs-on: "${{ inputs.runs-on }}"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v3"
with:
python-version: "3.9"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Build the collection"
run: "ansible-galaxy collection build --output-path build"
- name: "Publish the collection"
run: "ansible-galaxy collection publish build/* --api-key=${{ secrets.GALAXY_API_TOKEN }}"
needs:
- "tests"
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ on: # yamllint disable
- cron: "20 3 * * 1"

jobs:
ci:
uses: ./.github/workflows/jobs.yml
tests:
uses: ./.github/workflows/tests.yml
with:
full-integration: true

0 comments on commit a45222b

Please sign in to comment.