-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from vladgh/tests
Only trigger testing when the role files change
- Loading branch information
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -25,6 +43,7 @@ jobs: | |
- ubuntu2004 | ||
- debian11 | ||
- debian10 | ||
scenario: ${{ fromJSON(needs.changes.outputs.scenario) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -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 | ||
|