Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
165 changes: 25 additions & 140 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}


permissions:
contents: read

Expand All @@ -26,10 +25,10 @@ jobs:
timeout-minutes: 15 # Prevent hung jobs
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Comment thread
somethingwithproof marked this conversation as resolved.
Resolved
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -45,141 +44,27 @@ jobs:
- name: Run ansible-lint
run: ansible-lint

test-ubuntu-22:
name: Test - Ubuntu 22.04
runs-on: [self-hosted, linux, x64]
timeout-minutes: 20 # Prevent hung jobs
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install Molecule and dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
ansible-galaxy collection install ansible.posix

- name: Run Molecule test (default scenario)
run: molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

test-ubuntu-24:
name: Test - Ubuntu 24.04
runs-on: [self-hosted, linux, x64]
timeout-minutes: 20 # Prevent hung jobs
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install Molecule and dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
ansible-galaxy collection install ansible.posix

- name: Run Molecule test (Ubuntu scenario)
run: molecule test --scenario-name ubuntu
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

test-debian:
name: Test - Debian (11, 12)
runs-on: [self-hosted, linux, x64]
timeout-minutes: 20 # Prevent hung jobs
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install Molecule and dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
ansible-galaxy collection install ansible.posix

- name: Run Molecule test (Debian scenario)
run: molecule test --scenario-name debian
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

test-rocky-9:
name: Test - Rocky Linux 9
runs-on: [self-hosted, linux, x64]
timeout-minutes: 20 # Prevent hung jobs
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install Molecule and dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Ansible collections
run: |
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
ansible-galaxy collection install ansible.posix

- name: Run Molecule test (default scenario)
run: molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

test-rhel:
name: Test - RHEL (8, 9)
molecule-test:
name: Molecule Test (${{ matrix.name }})
runs-on: [self-hosted, linux, x64]
timeout-minutes: 20 # Prevent hung jobs
needs: lint
strategy:
fail-fast: false
matrix:
include:
- scenario: default
name: Ubuntu 22/24 and Rocky 9
- scenario: debian
name: Debian (11, 12)
- scenario: rhel
name: RHEL (8, 9)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
somethingwithproof marked this conversation as resolved.
Resolved
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'

Expand All @@ -194,8 +79,8 @@ jobs:
ansible-galaxy collection install community.mysql
ansible-galaxy collection install ansible.posix

- name: Run Molecule test (RHEL scenario)
run: molecule test --scenario-name rhel
- name: Run Molecule test (${{ matrix.scenario }} scenario)
run: molecule test --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
Expand All @@ -204,16 +89,16 @@ jobs:
name: Integration Test
runs-on: [self-hosted, linux, x64]
timeout-minutes: 15 # Prevent hung jobs
needs: [test-ubuntu-22, test-ubuntu-24, test-debian, test-rocky-9, test-rhel]
needs: [molecule-test]
Comment thread
somethingwithproof marked this conversation as resolved.
Resolved
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3

- name: Build test image
uses: docker/build-push-action@v7
uses: docker/build-push-action@ca877d9245402d1537745e0e3563b6a5408e6e4d # v6
with:
context: .
file: ./Dockerfile
Expand All @@ -237,12 +122,12 @@ jobs:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'

Expand All @@ -268,7 +153,7 @@ jobs:

- name: Create Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@de2c0eb89ae2a093354c5cb36e48c5e2b1c5d3e0 # v2
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
Expand Down
77 changes: 57 additions & 20 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,66 @@
---
name: Dependabot Auto-Merge

on:
pull_request:
"on":
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
schedule:
- cron: "17,47 * * * *"
workflow_dispatch:
branches: [ main ]

permissions:
contents: write
pull-requests: write
contents: read
checks: read

concurrency:
group: dependabot-auto-merge
cancel-in-progress: false
Comment on lines +15 to +17

jobs:
dependabot-auto-merge:
runs-on: [self-hosted, linux, x64]
if: ${{ github.actor == 'dependabot[bot]' }}

merge:
if: >-
github.event_name != 'pull_request_target' ||
github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: read
Comment on lines +24 to +28
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge PR
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
run: gh pr merge --auto --squash "$PR_URL"
- name: Merge Dependabot pull requests with successful checks
shell: bash
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail

gh pr list \
--repo "$GITHUB_REPOSITORY" \
--state open \
--author "app/dependabot" \
--json number,isDraft,mergeable \
--jq '.[] |
select(.isDraft == false and .mergeable == "MERGEABLE") |
.number' |
while read -r pr; do
[ -n "$pr" ] || continue

states=$(gh pr checks "$pr" \
--repo "$GITHUB_REPOSITORY" \
--json state \
--jq '.[].state' 2>/dev/null || true)

# Fail closed when a repository has no CI checks.
[ -n "$states" ] || continue

blocked='^(PENDING|QUEUED|IN_PROGRESS|FAILURE|ERROR|CANCELLED|'
blocked+='STALE|ACTION_REQUIRED)$'
if grep -Eq "$blocked" <<<"$states"; then
continue
fi
Comment on lines +48 to +60

gh pr merge "$pr" \
--repo "$GITHUB_REPOSITORY" \
--squash \
--delete-branch
done
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Comment on lines 24 to +28
Comment on lines 22 to +28
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -50,7 +50,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

Expand All @@ -75,7 +75,7 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@c12583777ecdfd3be55c69cf75464299dc01057e # v3
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
Expand Down Expand Up @@ -137,10 +137,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
cache: 'pip'
Expand Down
Loading