Skip to content

Commit

Permalink
Fix integration test workflow (#124)
Browse files Browse the repository at this point in the history
* Update integration test workflow

* add skip conditions
  • Loading branch information
haraprasadj authored Nov 7, 2024
1 parent 7d454e3 commit 4290b03
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,28 @@ jobs:
# - name: Enable Step Debugging
# run: echo "ACTIONS_STEP_DEBUG=true >> $GITHUB_ENV"

# Checkout current branch of gen3-code-vigil if it is the repo under test
- name: Checkout integration test code from dev branch
if: ${{ github.event.repository.name == 'gen3-code-vigil' }}
uses: actions/checkout@v4

# Checkout master branch of gen3-code-vigil when another repo is under test
- name: Checkout integration test code from master branch
if: ${{ github.event.repository.name != 'gen3-code-vigil' }}
uses: actions/checkout@v4
with:
repository: uc-cdis/gen3-code-vigil
ref: master

# Skip integration tests when the following PR labels are present:
# not-ready-for-ci / decommission-environment
- name: Skip integration tests for specific PR labels
working-directory: ${{ github.workspace }}
run: |
if gh api repos/$REPO_FN/pulls/$PR_NUM --jq '.labels | map(.name) | .[] | select(. == "not-ready-for-ci" or . == "decommission-environment")' | grep -q .; then
echo "Skipping CI since one of the PR labels is present - not-ready-for-ci / decommission-environment"
echo "SKIP_TESTS=true" >> $GITHUB_ENV
fi
# Checkout current repo
- name: Checkout current repo
if: ${{ env.SKIP_TESTS != 'true' }}
uses: actions/checkout@v4

# Skip tests when there are only markdown files
- name: Skip integration tests if PR contains only Markdown files
if: ${{ env.SKIP_TESTS != 'true' }}
working-directory: ${{ github.workspace }}
run: |
git fetch -q
FILE_TYPES=$(git show --name-only ${{ env.COMMIT_SHA }} | awk -F . '{print $NF}' | sort -u)
FILE_TYPES=$(git show --name-only ${{ env.COMMIT_SHA }} | grep -o '\S\+\.\S\+' | grep -v '@' | awk -F . '{print $NF}' | sort -u)
echo $FILE_TYPES
# Check if the only file type is markdown
Expand All @@ -109,6 +104,14 @@ jobs:
echo "SKIP_TESTS=true" >> $GITHUB_ENV
fi
# Checkout master branch of gen3-code-vigil when another repo is under test
- name: Checkout integration test code
if: ${{ env.SKIP_TESTS != 'true' && github.event.repository.name != 'gen3-code-vigil' }}
uses: actions/checkout@v4
with:
repository: uc-cdis/gen3-code-vigil
ref: master

# gen3-integration-tests run with python 3.9
- name: Set up Python
if: ${{ env.SKIP_TESTS != 'true' }}
Expand Down

0 comments on commit 4290b03

Please sign in to comment.