Skip to content

Commit 4290b03

Browse files
authored
Fix integration test workflow (#124)
* Update integration test workflow * add skip conditions
1 parent 7d454e3 commit 4290b03

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/integration_tests.yaml

+17-14
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,28 @@ jobs:
7474
# - name: Enable Step Debugging
7575
# run: echo "ACTIONS_STEP_DEBUG=true >> $GITHUB_ENV"
7676

77-
# Checkout current branch of gen3-code-vigil if it is the repo under test
78-
- name: Checkout integration test code from dev branch
79-
if: ${{ github.event.repository.name == 'gen3-code-vigil' }}
80-
uses: actions/checkout@v4
81-
82-
# Checkout master branch of gen3-code-vigil when another repo is under test
83-
- name: Checkout integration test code from master branch
84-
if: ${{ github.event.repository.name != 'gen3-code-vigil' }}
85-
uses: actions/checkout@v4
86-
with:
87-
repository: uc-cdis/gen3-code-vigil
88-
ref: master
89-
9077
# Skip integration tests when the following PR labels are present:
9178
# not-ready-for-ci / decommission-environment
9279
- name: Skip integration tests for specific PR labels
80+
working-directory: ${{ github.workspace }}
9381
run: |
9482
if gh api repos/$REPO_FN/pulls/$PR_NUM --jq '.labels | map(.name) | .[] | select(. == "not-ready-for-ci" or . == "decommission-environment")' | grep -q .; then
9583
echo "Skipping CI since one of the PR labels is present - not-ready-for-ci / decommission-environment"
9684
echo "SKIP_TESTS=true" >> $GITHUB_ENV
9785
fi
9886
87+
# Checkout current repo
88+
- name: Checkout current repo
89+
if: ${{ env.SKIP_TESTS != 'true' }}
90+
uses: actions/checkout@v4
91+
9992
# Skip tests when there are only markdown files
10093
- name: Skip integration tests if PR contains only Markdown files
94+
if: ${{ env.SKIP_TESTS != 'true' }}
95+
working-directory: ${{ github.workspace }}
10196
run: |
10297
git fetch -q
103-
FILE_TYPES=$(git show --name-only ${{ env.COMMIT_SHA }} | awk -F . '{print $NF}' | sort -u)
98+
FILE_TYPES=$(git show --name-only ${{ env.COMMIT_SHA }} | grep -o '\S\+\.\S\+' | grep -v '@' | awk -F . '{print $NF}' | sort -u)
10499
echo $FILE_TYPES
105100
106101
# Check if the only file type is markdown
@@ -109,6 +104,14 @@ jobs:
109104
echo "SKIP_TESTS=true" >> $GITHUB_ENV
110105
fi
111106
107+
# Checkout master branch of gen3-code-vigil when another repo is under test
108+
- name: Checkout integration test code
109+
if: ${{ env.SKIP_TESTS != 'true' && github.event.repository.name != 'gen3-code-vigil' }}
110+
uses: actions/checkout@v4
111+
with:
112+
repository: uc-cdis/gen3-code-vigil
113+
ref: master
114+
112115
# gen3-integration-tests run with python 3.9
113116
- name: Set up Python
114117
if: ${{ env.SKIP_TESTS != 'true' }}

0 commit comments

Comments
 (0)