Skip to content

[WIP] Run Integration Tests on PR #1

[WIP] Run Integration Tests on PR

[WIP] Run Integration Tests on PR #1

Workflow file for this run

name: Integration Tests
on:
pull_request:
workflow_dispatch:
inputs:
check_run_id:
description: "ID for the Check Run in a PR"
type: string
required: false
pull_request_number:
description: "Pull request number to test (if empty, tests run against main)"
required: false
jobs:
myEvent:
runs-on: ubuntu-latest
steps:
- name: Acknowledge Request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'status=in_progress' \
-f 'output[title]=Run Integration Tests' \
-f 'output[summary]=Running Integration Tests for Java SDK' \
/repos/${{ github.repository }}/check-runs/${{ github.event.inputs.checkRunId }}
####################################################
# Actually, we'll just sleep to simulate some work
####################################################
- name: Processing
run: sleep 10
- name: Complete Check
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/check-runs/${{ github.event.inputs.checkRunId }} \
--input - <<- EOF
{
"conclusion": "success",
"output": {
"title": "Run Integration Tests",
"summary": "[Execution Details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})",
"text": "Successful execution of Integration Tests for Java SDK"
}
}
EOF
- name: Fail Check
if: failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/check-runs/${{ github.event.inputs.checkRunId }} \
--input - <<- EOF
{
"conclusion": "failure",
"output": {
"title": "Run Integration Tests",
"summary": "[Execution Details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})",
"text": "Failed execution of Integration Tests for Java SDK"
}
}
EOF