Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init attempt to introduce molecule tests via GHA #8

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
39 changes: 39 additions & 0 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Molecule-test

on:
push:
branches:
- master
pull_request: null
jobs:
molecule:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenario:
- centos7
- Debian10
- debian11
- fedora35
- oraclelinux8
- rockylinux8
- ubuntu18.04
- ubuntu2004
- ubuntu2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: "${{ github.repository }}"
- name: Init python env
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install ansible-lint molecule molecule-plugins[docker] docker flake8 flake8-bugbear flake8-docstrings flake8-import-order flake8-pylint pytest pytest-testinfra yamllint
- name: Run molecule tests
run: |
molecule test --scenario-name ${{ matrix.scenario }} --platform-name ${{ matrix.scenario }}
7 changes: 4 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
dependency:
name: galaxy

options:
role-file: requirements.yml
driver:
name: docker

Expand All @@ -13,12 +14,12 @@ platforms:

- name: Debian10
image: debian:10
pre_build_image: false
pre_build_image: true
dockerfile: ../common/Dockerfile_debian10.j2

- name: debian11
image: debian:11
pre_build_image: false
pre_build_image: true
dockerfile: ../common/Dockerfile_debian11.j2

- name: fedora35
Expand Down
5 changes: 5 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
collections:
- name: community.docker
version: "*" # Need to ensure that the latest version is installed or Molecule fails
roles: []
Loading