From 241dae5ba41506c91cffcf07d07df5b1d06eb573 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Mon, 16 May 2022 19:55:43 +0200 Subject: [PATCH] CI: Add Arch Linux to the test matrix Recently, there was a regression because a parameter has been introduced which is only present for Red Hat and Debian systems. When adding other Linux distributions to the test suite, errors like this might get caught in the future. --- .github/workflows/ci.yml | 19 ++++++++++++++++++- molecule/default/molecule.yml | 7 +++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7df509a..df50cf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,10 @@ jobs: name: Molecule runs-on: ubuntu-latest strategy: + fail-fast: false matrix: distro: + - archlinux - rockylinux8 - centos7 - ubuntu2004 @@ -64,9 +66,24 @@ jobs: - name: Install test dependencies. run: pip3 install ansible molecule[docker] docker + - name: Provide MOLECULE_DISTRO to environment + run: echo "MOLECULE_DISTRO=${{ matrix.distro || 'centos7' }}" >> $GITHUB_ENV + - name: Run Molecule tests. + if: matrix.distro != 'archlinux' run: molecule test env: PY_COLORS: '1' ANSIBLE_FORCE_COLOR: '1' - MOLECULE_DISTRO: ${{ matrix.distro }} + CI_IMAGE: geerlingguy/docker-${{ env.MOLECULE_DISTRO }}-ansible:latest + + - name: Run Molecule tests on Arch Linux. + if: matrix.distro == 'archlinux' + run: molecule test + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + # CI_IMAGE: mesaguy/ansible-molecule-archlinux:latest + # CI_IMAGE: carlodepieri/docker-archlinux-ansible:latest + # CI_IMAGE: ghcr.io/avnes/molecule-arch:latest + CI_IMAGE: archlinux:base-20210328.0.18194 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 7490710..4563577 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -5,10 +5,13 @@ driver: name: docker platforms: - name: instance - image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" + image: ${CI_IMAGE} command: ${MOLECULE_DOCKER_COMMAND:-""} + tmpfs: + - /run + - /tmp volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw privileged: true pre_build_image: true provisioner: