added some more configuration variables and changed some defaults to … #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
ansible-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
path: "${{ github.repository }}" | |
- name: Run ansible-lint | |
uses: ansible-community/ansible-lint-action@main | |
with: | |
path: "${{ github.repository }}" | |
test: | |
needs: | |
- ansible-lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- name: "centos" | |
namespace: "quay.io/centos" | |
tag: "stream8" | |
- name: "centos" | |
namespace: "quay.io/centos" | |
tag: "stream9" | |
- name: "fedora" | |
namespace: "quay.io/fedora" | |
tag: "latest" | |
scenario: | |
- default | |
- auto_reboot | |
container: | |
image: "quay.io/fedora/fedora:latest" | |
# --cgroupns=host needed due to https://github.com/containers/podman/discussions/12898#discussioncomment-4078154 | |
options: "--privileged --volume /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host" | |
env: | |
HOME: "/root" | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
path: "${{ github.repository }}" | |
- name: install dependencies | |
run: | | |
dnf install -y podman \ | |
which \ | |
python3-molecule \ | |
python3-click-help-colors \ | |
python3-rich \ | |
python3-enrich \ | |
python3-pluggy \ | |
python3-cookiecutter | |
- name: run molecule | |
run: | | |
export HOME="/root" | |
export image="${{ matrix.image.name }}" | |
export namespace="${{ matrix.image.namespace }}" | |
export tag="${{ matrix.image.tag }}" | |
export PY_COLORS=1 | |
export ANSIBLE_FORCE_COLOR=1 | |
molecule test -s "${{ matrix.scenario }}" | |
working-directory: "${{ github.repository }}" |