Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasfalcone committed Jul 19, 2023
1 parent 9f1d08a commit 7bd8b6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/diffs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ jobs:

strategy:
matrix:
project: # Filter , compilation path
- ['src.*one.*cpp', /src/one]
- ['src.*two.*cpp', /src/two]
dependencies:
- ['src.*one.*cpp', 'src.*two.*cpp']
- ['src.*two.*cpp']
path:
- src/one
- src/two
steps:
# Prepare project repository.
- name: Checkout repository
Expand All @@ -19,8 +22,14 @@ jobs:

- name: Check for compilation requirement
run: |
grep_command=""
for filter in ${{ matrix.dependencies[@] }}; do
grep_command=" | $grep_command -e $filter"
done
DIFFS=$(git diff --name-only HEAD HEAD~1)
if echo $DIFFS | grep -q "${{ matrix.project[0] }}"; then
if echo $DIFFS | $(grep_command)"; then
echo "COMPILATION_FLAG=true" >> $GITHUB_ENV
else
echo "COMPILATION_FLAG=false" >> $GITHUB_ENV
Expand Down
2 changes: 2 additions & 0 deletions src/two/include.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
int include()
{
int two = 2

return 0;
}

0 comments on commit 7bd8b6c

Please sign in to comment.