* allow multiple instances for os vm tests Signed-off-by: Martin Schurz <[email protected]> * add scheduled trigger to all test actions Signed-off-by: Martin Schurz <[email protected]> * use different scenario names Signed-off-by: Martin Schurz <[email protected]> * use different scenario names Signed-off-by: Martin Schurz <[email protected]> * use different scenario names Signed-off-by: Martin Schurz <[email protected]> * use username to create uniqe vms Signed-off-by: Martin Schurz <[email protected]> * use compatible name Signed-off-by: Martin Schurz <[email protected]> * add explaination Signed-off-by: Martin Schurz <[email protected]> --------- Signed-off-by: Martin Schurz <[email protected]>
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
---
|
|
name: "devsec.mysql_hardening"
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'roles/mysql_hardening/**'
|
|
- 'molecule/mysql_hardening/**'
|
|
- '.github/workflows/mysql_hardening.yml'
|
|
pull_request:
|
|
branches: [master]
|
|
paths:
|
|
- 'roles/mysql_hardening/**'
|
|
- 'molecule/mysql_hardening/**'
|
|
- '.github/workflows/mysql_hardening.yml'
|
|
schedule:
|
|
- cron: '0 6 * * 0'
|
|
|
|
concurrency:
|
|
group: >-
|
|
${{ github.workflow }}-${{
|
|
github.event.pull_request.number || github.sha
|
|
}}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-18.04
|
|
env:
|
|
PY_COLORS: 1
|
|
ANSIBLE_FORCE_COLOR: 1
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
molecule_distro:
|
|
- centos7
|
|
- centosstream8
|
|
- centosstream9
|
|
- rocky8
|
|
- rocky9
|
|
- ubuntu1804
|
|
- ubuntu2004
|
|
- ubuntu2204
|
|
- debian10
|
|
- debian11
|
|
# - amazon # geerlingguy.mysql does not support fedora
|
|
# - arch # needs to be fixed
|
|
- opensuse_tumbleweed # needs to be fixed
|
|
# - fedora # geerlingguy.mysql does not support fedora
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: ansible_collections/devsec/hardening
|
|
submodules: true
|
|
|
|
- name: Set up Python 3.7
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt install git
|
|
python -m pip install --no-cache-dir --upgrade pip
|
|
pip install -r requirements.txt
|
|
working-directory: ansible_collections/devsec/hardening
|
|
|
|
- name: Create default collection path symlink
|
|
run: |
|
|
mkdir -p /home/runner/.ansible
|
|
ln -s /home/runner/work/ansible-os-hardening/ansible-os-hardening /home/runner/.ansible/collections
|
|
|
|
# that was a hard one to fix. robert did it thankfully
|
|
# https://github.com/robertdebock/ansible-role-mysql/commit/7562e99099b06282391ab7ed102b393a0406d212
|
|
- name: disable apparmor on debian systems
|
|
run: |
|
|
set -x
|
|
sudo apt-get install apparmor-profiles
|
|
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
|
|
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
|
|
if: ${{ startsWith(matrix.molecule_distro, 'Debian') }}
|
|
|
|
- name: Test with molecule
|
|
run: |
|
|
molecule --version
|
|
molecule test -s mysql_hardening
|
|
env:
|
|
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
|
|
working-directory: ansible_collections/devsec/hardening
|