Files
ansible-role-common/.github/workflows/ci.yml
Aaron Guise e5e3f88413
All checks were successful
CI / lint (push) Successful in 52s
CI / Molecule Test (almalinux8) (push) Successful in 1m15s
CI / Molecule Test (almalinux9) (push) Successful in 1m54s
CI / release (push) Successful in 23s
CI / notify (push) Successful in 24s
Regular test / Molecule Test (almalinux8) (push) Successful in 1m19s
Regular test / Molecule Test (almalinux9) (push) Successful in 5m51s
Regular test / notify (push) Successful in 7s
fix(ci): Let go-semantic-release get latest drivers from web 🐛 💚
2025-04-14 11:26:55 +12:00

102 lines
2.7 KiB
YAML

name: CI
on:
push:
branches:
- "**"
tags:
- "!**"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- name: Ensure requirements are installed
run: pip install -r requirements.txt
- name: Lint with ansible-lint
run: ansible-lint -c ".ansible-lint"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Lint with yamllint
run: yamllint .
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
molecule:
name: Molecule Test
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: true
matrix:
os: [almalinux8, almalinux9]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- name: Ensure requirements are installed
run: pip install -r requirements.txt
- name: Run Molecule tests.
run: molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.os }}
release:
runs-on: ubuntu-latest
needs:
- lint
- molecule
steps:
- uses: actions/checkout@v4
- uses: go-semantic-release/action@v1
with:
custom-arguments: --provider=gitea
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}
notify:
runs-on: ubuntu-latest
needs:
- lint
- molecule
- release
steps:
- name: ntfy-success-notifications
uses: niniyas/ntfy-action@master
if: success()
with:
url: '${{ vars.NTFY_URL }}'
title: Workflow success - ansible-role-common
topic: 'ci-status'
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
priority: 4
tags: +1,partying_face,action,successfully,completed
details: Workflow has been successfully completed!
icon: 'https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png'
image: true
- name: ntfy-failed-notifications
uses: niniyas/ntfy-action@master
if: failure()
with:
url: '${{ vars.NTFY_URL }}'
title: Workflow failed - ansible-role-common
topic: 'ci-status'
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
priority: 5
tags: -1,skull,action,failed
details: Workflow has failed!
actions: 'default'