From ceb7a69406ec91c36d9f013cc1945dbf45666e42 Mon Sep 17 00:00:00 2001 From: Niall Byrne <9848926+niall-byrne@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:47:36 -0500 Subject: [PATCH] ci(GITHUB): run all molecule scenarios --- .../.github/workflows/push.yml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/push.yml b/{{cookiecutter.project_slug}}/.github/workflows/push.yml index 8c6f39b0..990e3e87 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/push.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/push.yml @@ -249,6 +249,7 @@ jobs: max-parallel: 4 matrix: python-version: ${{ fromJson(needs._create_python_versions.outputs.python-versions) }} + scenario: ["docker1", "hostmachine1"] steps: - name: Molecule Test -- Checkout Repository @@ -295,10 +296,26 @@ jobs: cd role source ./.github/scripts/poetry.sh "install-project" - - name: Molecule Test -- Run docker1 Scenario + - name: Molecule Test -- Reuse Cached Dependencies as Scenario run: | cd role - poetry run molecule test -s docker1 + poetry run molecule dependency + mv ~/.cache/molecule/role/default ~/.cache/molecule/role/"${SCENARIO}" + env: + SCENARIO: ${{ matrix.scenario }} + + - name: Molecule Test -- Run ${{ matrix.scenario }} Scenario + run: | + cd role + poetry run molecule test -s "${SCENARIO}" + env: + SCENARIO: ${{ matrix.scenario }} + + - name: Molecule Test -- Reuse Scenario Dependencies as Cache + run: | + mv ~/.cache/molecule/role/"${SCENARIO}" ~/.cache/molecule/role/default + env: + SCENARIO: ${{ matrix.scenario }} - name: Molecule Test -- Report Job Status (Success) if: env.VERBOSE_NOTIFICATIONS == '1'