diff --git a/.github/workflows/molecule_playbooks.yml b/.github/workflows/molecule.yml similarity index 59% rename from .github/workflows/molecule_playbooks.yml rename to .github/workflows/molecule.yml index e1ad73bc..02c11d17 100644 --- a/.github/workflows/molecule_playbooks.yml +++ b/.github/workflows/molecule.yml @@ -4,28 +4,19 @@ name: Molecule on: push: branches: - - master + - main pull_request: branches: - - master + - main jobs: - molecule: + provide_scenarios: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - scenario: - - centos-8 - - debian-10 - - fedora-34 - - oraclelinux-8 - - ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4 - with: - path: "${{ github.repository }}" + uses: actions/checkout@v4 + with: + path: "${{ github.repository }}" - name: Get changed files id: changed-files-yaml uses: tj-actions/changed-files@v39 @@ -35,11 +26,25 @@ jobs: - 'playbooks/*.yml' roles: - 'playbooks/roles/**/**' + - name: Debug + run: echo ${{ steps.changed-files-yaml.outputs.all_changed_files }} + outputs: + matrix: ${{ steps.changed-files-yaml.outputs.all_changed_files }} + molecule: + needs: provide_scenarios + strategy: + fail-fast: false + matrix: + scenario: ${{ fromJson(needs.provide_scenarios.outputs.matrix) }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: "${{ github.repository }}" - name: Molecule tests for playbooks uses: gofrolist/molecule-action@v2 - if: steps.changed-files-yaml.outputs.playbooks_any_changed == 'true' with: molecule_command: test - molecule_args: --scenario-name ${{ steps.changed-files-yaml.outputs.playbooks_all_changed_files }} + molecule_args: --scenario-name ${{ matrix.scenario }} env: ANSIBLE_FORCE_COLOR: '1' \ No newline at end of file