Skip to content

Commit

Permalink
Added trigger for L2 tests. (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
sundargs2000 committed Mar 31, 2021
1 parent edc063c commit 62aeada
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/TriggerIntegrationTests.sh
@@ -0,0 +1,33 @@
token=$1
commit=$2
repository=$3
prNumber=$4
frombranch=$5
tobranch=$6
patUser=$7

getPayLoad() {
cat <<EOF
{
"event_type": "SetupHelmActionPR",
"client_payload":
{
"action": "SetupHelm",
"commit": "$commit",
"repository": "$repository",
"prNumber": "$prNumber",
"tobranch": "$tobranch",
"frombranch": "$frombranch"
}
}
EOF
}

response=$(curl -u $patUser:$token -X POST https://api.github.com/repos/Azure/azure-actions-integration-tests/dispatches --data "$(getPayLoad)")

if [ "$response" == "" ]; then
echo "Integration tests triggered successfully"
else
echo "Triggering integration tests failed with: '$response'"
exit 1
fi
19 changes: 19 additions & 0 deletions .github/workflows/integration-tests.yml
@@ -0,0 +1,19 @@
name: "Trigger Integration tests"
on:
pull_request:
branches:
- master
- 'releases/*'
jobs:
trigger-integration-tests:
name: Trigger Integration tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
path: IntegrationTests

- name: Trigger Test run
run: |
bash ./IntegrationTests/.github/workflows/TriggerIntegrationTests.sh ${{ secrets.L2_REPO_TOKEN }} ${{ github.event.pull_request.head.sha }} ${{ github.repository }} ${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }} ${{ secrets.L2_REPO_USER }}
@@ -1,4 +1,4 @@
name: "build-test"
name: "Run unit tests."
on: # rebuild any PRs and main branch changes
pull_request:
branches:
Expand All @@ -14,7 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |

- name: Run L0 tests.
run: |
npm install
npm build
npm test

0 comments on commit 62aeada

Please sign in to comment.