[PR 2]: Added support for listing all modified files. (#285)
* Added support for listing all modified files. * Updated the test.
This commit is contained in:
87
.github/workflows/test.yml
vendored
87
.github/workflows/test.yml
vendored
@@ -236,6 +236,15 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified for specific files
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted for specific files
|
||||
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
@@ -252,10 +261,22 @@ jobs:
|
||||
files: |
|
||||
entrypoint.sh
|
||||
*.sh
|
||||
- name: Verify all_changed_and_modified_files files has no duplicates
|
||||
- name: Verify all_changed_files files has no duplicates
|
||||
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_changed_files, 'entrypoint.sh')
|
||||
run: |
|
||||
ALL_CHANGED_AND_MODIFIED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_changed_files }})
|
||||
ALL_CHANGED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_changed_files }})
|
||||
UNIQUE_ALL_CHANGED_FILES=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sort -u | xargs)
|
||||
|
||||
if [[ "$ALL_CHANGED_FILES[@]" != "$UNIQUE_ALL_CHANGED_FILES[@]" ]]; then
|
||||
echo "Duplicate output: Expected "$UNIQUE_ALL_CHANGED_FILES" got $ALL_CHANGED_FILES"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify all_changed_and_modified_files files has no duplicates
|
||||
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_changed_and_modified_files, 'entrypoint.sh')
|
||||
run: |
|
||||
ALL_CHANGED_AND_MODIFIED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_changed_and_modified_files }})
|
||||
UNIQUE_ALL_CHANGED_AND_MODIFIED_FILES=$(echo "$ALL_CHANGED_AND_MODIFIED_FILES" | tr ' ' '\n' | sort -u | xargs)
|
||||
|
||||
if [[ "$ALL_CHANGED_AND_MODIFIED_FILES[@]" != "$UNIQUE_ALL_CHANGED_AND_MODIFIED_FILES[@]" ]]; then
|
||||
@@ -264,6 +285,18 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify all_modified_files files has no duplicates
|
||||
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_modified_files, 'entrypoint.sh')
|
||||
run: |
|
||||
ALL_MODIFIED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_modified_files }})
|
||||
UNIQUE_ALL_MODIFIED_FILES=$(echo "$ALL_MODIFIED_FILES" | tr ' ' '\n' | sort -u | xargs)
|
||||
|
||||
if [[ "$ALL_MODIFIED_FILES[@]" != "$UNIQUE_ALL_MODIFIED_FILES[@]" ]]; then
|
||||
echo "Duplicate output: Expected "$UNIQUE_ALL_MODIFIED_FILES" got $ALL_MODIFIED_FILES"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with specific files comma separator
|
||||
id: changed-files-specific-comma
|
||||
uses: ./
|
||||
@@ -286,6 +319,15 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
@@ -317,6 +359,15 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
@@ -348,6 +399,15 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
@@ -380,6 +440,20 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified from source files
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/test.yml') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/rebase.yml')
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted from source files
|
||||
if: "!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
@@ -415,6 +489,15 @@ jobs:
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files with comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user