From 6ea000f7f7b7350d1b79d5eeb53d912f39f68138 Mon Sep 17 00:00:00 2001 From: trfore Date: Thu, 6 Jun 2024 17:45:04 -0500 Subject: [PATCH] ci: use ubuntu20 for cgroup compatibility --- .github/workflows/ci.yml | 2 +- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 767912d..294c59a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - distro: centos8 experimental: true molecule_scenario: "-s default" - uses: trfore/ansible-role/.github/workflows/test_ansible.yml@main # remote repo + uses: ./.github/workflows/test.yml with: distro: ${{ matrix.distro }} experimental: ${{ matrix.experimental }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7b27be2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Run Molecule Test +on: + workflow_call: + inputs: + distro: + required: true + type: string + experimental: + default: false + required: false + type: boolean + molecule_glob: + default: "molecule/*/molecule.yml" + required: false + type: string + molecule_scenario: + default: "" # ex: "-s SCENARIO_NAME" + required: false + type: string + requirements_file: + default: "requirements.txt" + required: false + type: string +jobs: + molecule: + runs-on: ubuntu-20.04 + continue-on-error: ${{ inputs.experimental }} + env: + PY_COLORS: "1" + ANSIBLE_FORCE_COLOR: "1" + MOLECULE_GLOB: ${{ inputs.molecule_glob }} + MOLECULE_NAME: ${{ inputs.distro }} + MOLECULE_IMAGE: trfore/docker-${{ inputs.distro }}-systemd + steps: + - name: Check out codebase + uses: actions/checkout@v4 + + - name: Setup python 3 + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: pip install -r ${{ inputs.requirements_file }} + + - name: Run molecule test + run: molecule test ${{ inputs.molecule_scenario }}