Skip to content

Commit

Permalink
chore: add test to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Sep 6, 2022
1 parent 4dec0b8 commit 0577f5e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/integration-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ jobs:
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: ${{ inputs.main-branch-name }}

- name: Verify default PR Workflow
if: ${{ github.event_name == 'pull_request' }}
run: |
BASE_SHA=$(echo $(git merge-base origin/${{github.base_ref}} HEAD))
HEAD_SHA=$(git rev-parse HEAD)
node -e "if(process.env.NX_BASE == '${BASE_SHA}') console.log('Base set correctly'); else { throw new Error('Base not set correctly!');}"
node -e "if(process.env.NX_HEAD == '${HEAD_SHA}') console.log('Head set correctly'); else { throw new Error('Head not set correctly!');}"
- name: Verify default Push Workflow
if: ${{ github.event_name != 'pull_request' }}
run: |
BASE_SHA=$(echo $(git rev-parse HEAD~1))
HEAD_SHA=$(echo $(git rev-parse HEAD))
node -e "if(process.env.NX_BASE == '${BASE_SHA}') console.log('Base set correctly'); else { throw new Error('Base not set correctly!');}"
node -e "if(process.env.NX_HEAD == '${HEAD_SHA}') console.log('Head set correctly'); else { throw new Error('Head not set correctly!');}"
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
fail-fast: false
uses: ./.github/workflows/integration-test-workflow.yml
with:
working-directory: ./integration-test
working-directory: integration-test
main-branch-name: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
runs-on: ${{ matrix.runs-on }}

0 comments on commit 0577f5e

Please sign in to comment.