Skip to content

Commit

Permalink
Update input skip patterns (netdata#16984)
Browse files Browse the repository at this point in the history
* Fix minor typo:
   - job name will be file-check in any workflow
   - file-check job has a step which is check-file

* Print any modified files

* Change glob patterns for all source files (*.c, *.h etc). With the previous approach they only matched the root folder

---------

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
  • Loading branch information
tkatsoulas and ilyam8 authored Feb 10, 2024
1 parent 3f59438 commit 29c1b54
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 40 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
**.c
**.cc
**.h
**.hh
**.in
**.patch
**.cmake
**/*.c
**/*.cc
**/*.h
**/*.hh
**/*.in
**/*.patch
**/*.cmake
CMakeLists.txt
netdata-installer.sh
.github/data/distros.yml
Expand All @@ -64,8 +64,14 @@ jobs:
web/server/h2o/libh2o/
files_ignore: |
netdata.spec.in
**.md
negation_patterns_first: true
**/*.md
- name: List all modified files in pattern
env:
ALL_MODIFIED_FILES: ${{ steps.check-files.outputs.all_modified_files }}
run: |
for file in ${ALL_MODIFIED_FILES}; do
echo "$file was modified"
done
- name: Check Run
id: check-run
run: |
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
**.c
**.cc
**.h
**.hh
**.in
**.patch
**.cmake
**/*.c
**/*.cc
**/*.h
**/*.hh
**/*.in
**/*.patch
**/*.cmake
CMakeLists.txt
.gitignore
.github/data/distros.yml
Expand All @@ -52,8 +52,14 @@ jobs:
web/server/h2o/libh2o/
files_ignore: |
netdata.spec.in
**.md
negation_patterns_first: true
**/*.md
- name: List all modified files in pattern
env:
ALL_MODIFIED_FILES: ${{ steps.check-files.outputs.all_modified_files }}
run: |
for file in ${ALL_MODIFIED_FILES}; do
echo "$file was modified"
done
- name: Check Run
id: check-run
run: |
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Check files
id: file-check
id: check-files
uses: tj-actions/changed-files@v42
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
**.c
**.cc
**.h
**.hh
**.in
**.patch
**.cmake
**/*.c
**/*.cc
**/*.h
**/*.hh
**/*.in
**/*.patch
**/*.cmake
.dockerignore
CMakeLists.txt
netdata-installer.sh
Expand All @@ -58,12 +58,18 @@ jobs:
web/server/h2o/libh2o/
files_ignore: |
netdata.spec.in
**.md
negation_patterns_first: true
**/*.md
- name: List all modified files in pattern
env:
ALL_MODIFIED_FILES: ${{ steps.check-files.outputs.all_modified_files }}
run: |
for file in ${ALL_MODIFIED_FILES}; do
echo "$file was modified"
done
- name: Check Run
id: check-run
run: |
if [ "${{ steps.file-check.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo 'run=true' >> "${GITHUB_OUTPUT}"
else
echo 'run=false' >> "${GITHUB_OUTPUT}"
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Check files
id: file-check
id: check-files
uses: tj-actions/changed-files@v42
with:
since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
files: |
**.c
**.cc
**.h
**.hh
**.in
**.patch
**.cmake
**/*.c
**/*.cc
**/*.h
**/*.hh
**/*.in
**/*.patch
**/*.cmake
netdata.spec.in
contrib/debian/
CMakeLists.txt
Expand All @@ -67,12 +67,18 @@ jobs:
src/fluent-bit/
web/server/h2o/libh2o/
files_ignore: |
**.md
negation_patterns_first: true
**/*.md
- name: List all modified files in pattern
env:
ALL_MODIFIED_FILES: ${{ steps.check-files.outputs.all_modified_files }}
run: |
for file in ${ALL_MODIFIED_FILES}; do
echo "$file was modified"
done
- name: Check Run
id: check-run
run: |
if [ "${{ steps.file-check.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo 'run=true' >> "${GITHUB_OUTPUT}"
else
echo 'run=false' >> "${GITHUB_OUTPUT}"
Expand Down

0 comments on commit 29c1b54

Please sign in to comment.