Skip to content

Commit

Permalink
Merge pull request #15 from vladgh/tests
Browse files Browse the repository at this point in the history
Only trigger testing when the role files change
  • Loading branch information
vladgh authored Oct 31, 2022
2 parents 63c60e1 + 7e2bd72 commit 4e63e08
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,27 @@ on:
- published

jobs:
changes:
name: Detect file changes
runs-on: ubuntu-latest
outputs:
scenario: ${{ steps.filter.outputs.changes }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Detect changes
uses: dorny/[email protected]
id: filter
with:
filters: |
default:
- roles/server/**/!(**.md)
- molecule/default/**
test:
name: "Test on ${{ matrix.os }}"
name: "Test scenario ${{ matrix.scenario }} on ${{ matrix.os }}"
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.scenario != '[]' && needs.changes.outputs.scenario != '' }}
strategy:
fail-fast: true
matrix:
Expand All @@ -25,6 +43,7 @@ jobs:
- ubuntu2004
- debian11
- debian10
scenario: ${{ fromJSON(needs.changes.outputs.scenario) }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -34,6 +53,7 @@ jobs:
uses: gofrolist/molecule-action@v2
with:
molecule_command: test
molecule_args: --scenario-name ${{ matrix.scenario }}
molecule_working_dir: ansible_collections/vladgh/samba
env:
PY_COLORS: 1
Expand Down

0 comments on commit 4e63e08

Please sign in to comment.