diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml new file mode 100644 index 0000000..381f1c5 --- /dev/null +++ b/.github/workflows/molecule-test.yml @@ -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 }} \ No newline at end of file diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 1aaaca2..1d459eb 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,7 +1,8 @@ --- dependency: name: galaxy - + options: + role-file: requirements.yml driver: name: docker @@ -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 diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..3f4f2ea --- /dev/null +++ b/requirements.yml @@ -0,0 +1,5 @@ +--- +collections: + - name: community.docker + version: "*" # Need to ensure that the latest version is installed or Molecule fails +roles: [] \ No newline at end of file