Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jan 17, 2024
1 parent 457ba3e commit a979d72
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, windows-2022]
path: ['.', 'dir1']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
path: ${{ matrix.path }}
- name: Test files has no changes
uses: ./
uses: ${{ matrix.path }}
id: changed_files_not_expected
with:
path: ${{ matrix.path }}
files: |
test/*.txt
test/*.sql
Expand All @@ -44,9 +48,10 @@ jobs:
echo "Changed files (Not expected): ${{ steps.changed_files_not_expected.outputs.changed_files }}"
exit 1
- name: Test dont fail if not changed
uses: ./
uses: ${{ matrix.path }}
id: changed_files_not_expected_fail
with:
path: ${{ matrix.path }}
fail-if-changed: true
files: |
test/*.txt
Expand All @@ -61,9 +66,10 @@ jobs:
printf '%s\n' "323442" "424" >> "test/\$(whoami).txt"
shell: bash
- name: Test test/new*.txt file has changes
uses: ./
uses: ${{ matrix.path }}
id: changed_files_expected
with:
path: ${{ matrix.path }}
separator: '\n'
files: |
test/*.txt
Expand All @@ -80,10 +86,11 @@ jobs:
echo "No Changes found: (Not expected)"
exit 1
- name: Test fail if changed
uses: ./
uses: ${{ matrix.path }}
id: changed_files_expected_fail
continue-on-error: true
with:
path: ${{ matrix.path }}
fail-if-changed: true
files: |
test/*.txt
Expand All @@ -94,9 +101,10 @@ jobs:
run: |
echo "New changes" > unstaged.txt
- name: Test unstaged file has changes
uses: ./
uses: ${{ matrix.path }}
id: changed_unstaged_files_expected
with:
path: ${{ matrix.path }}
files: |
unstaged.txt
- name: Display unstaged changed files
Expand All @@ -109,9 +117,10 @@ jobs:
echo "No Changes found: (Not expected)"
exit 1
- name: Test unstaged file changes are ignored
uses: ./
uses: ${{ matrix.path }}
id: changed_unstaged_files_not_expected
with:
path: ${{ matrix.path }}
files: |
!test/new.txt
!test/new1.txt
Expand All @@ -124,9 +133,10 @@ jobs:
echo "Changes found: (Not expected)"
exit 1
- name: Test unstaged file has changes
uses: ./
uses: ${{ matrix.path }}
id: changed_unstaged2_files_expected
with:
path: ${{ matrix.path }}
files: |
!test/new.txt
!test/new1.txt
Expand All @@ -144,8 +154,10 @@ jobs:
rm test/new.txt
- name: Test deletion of test/new.txt
uses: ./
uses: ${{ matrix.path }}
id: deleted_file_test
with:
path: ${{ matrix.path }}

- name: Show output
run: |
Expand Down

0 comments on commit a979d72

Please sign in to comment.