Skip to content

Commit

Permalink
update build environment
Browse files Browse the repository at this point in the history
update README
update github workflows
update molecule tests
  • Loading branch information
bodsch committed Dec 6, 2022
1 parent ccf5620 commit 4f3fb3b
Show file tree
Hide file tree
Showing 36 changed files with 713 additions and 263 deletions.
4 changes: 3 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

skip_list:
- role-name
- name[casing]
- name[template]
30 changes: 30 additions & 0 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

name: push to ansible galaxy

on:
workflow_dispatch:
workflow_run:
workflows:
- "CI"
branches:
- main
types:
- completed

jobs:
galaxy:
name: galaxy
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out the codebase
uses: actions/checkout@v3
with:
path: 'ansible-users'

- name: galaxy
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: main
33 changes: 33 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---

name: code linter

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- testing

jobs:
lint:
name: linting
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_ANSIBLE: true
# VALIDATE_MARKDOWN: true
VALIDATE_YAML: true

...
125 changes: 47 additions & 78 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,51 @@
name: CI

on:
pull_request:
push:
schedule:
- cron: "0 4 * * 0"
workflow_dispatch:
workflow_run:
workflows:
- "code linter"
branches:
- main
schedule:
- cron: "0 2 * * 0"
- feature/*
- fix/*
types:
- completed

defaults:
run:
working-directory: 'ansible-users'

jobs:
lint:
name: linting
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
# DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_ANSIBLE: true
# VALIDATE_MARKDOWN: true
VALIDATE_YAML: true

arch:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- archlinux:latest
python-version:
- '3.9'
- artixlinux:latest
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.1'
- '6.1'
scenario:
- default

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-users'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -67,41 +55,40 @@ jobs:
- name: test default
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- \
molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

deb:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- debian:10
- debian:11
- ubuntu:20.04
python-version:
- '3.9'
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.1'
- '6.1'
scenario:
- default

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-users'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -110,41 +97,37 @@ jobs:
- name: test default
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- \
molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

rpm:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- oraclelinux:8
- rockylinux:8
- almalinux:8
python-version:
- '3.9'
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.1'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-users'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -153,23 +136,9 @@ jobs:
- name: test default
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- \
molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

publish:
if: github.ref == 'refs/heads/main'
needs:
- arch
- deb
- rpm
runs-on: ubuntu-18.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: main
59 changes: 59 additions & 0 deletions .github/workflows/role-configured.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: create users

on:
schedule:
- cron: "0 4 * * 0"
workflow_dispatch:
workflow_run:
workflows:
- "code linter"
branches:
- main
- feature/*
- fix/*
types:
- completed

defaults:
run:
working-directory: 'ansible-users'

jobs:

deb:
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- debian:11
ansible-version:
- '6.1'

steps:
- name: check out the codebase.
uses: actions/checkout@v3
with:
path: 'ansible-users'

- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
- name: test default
run: |
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name configured
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}
Loading

0 comments on commit 4f3fb3b

Please sign in to comment.