Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Jul 19, 2024
1 parent 8f02572 commit 5b2ba08
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Integration Tests
on:
repository_dispatch:
types: [integration-check]
types: [my-check]
jobs:
myEvent:
runs-on: ubuntu-latest
Expand All @@ -17,8 +17,8 @@ jobs:
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]=Integration Tests' \
-f 'output[summary]=Running Integration Tests for Py SDK' \
-f 'output[title]=My Check Run Title' \
-f 'output[summary]=A *fancy* summary' \
/repos/${{ github.repository }}/check-runs/${{ github.event.client_payload.checkRunId }}
####################################################
Expand All @@ -44,11 +44,10 @@ jobs:
--input - <<- EOF
{
"conclusion": "success",
"details_url": "TODO",
"output": {
"title": "Integration Tests",
"title": "My Check Run Title",
"summary": "**Summary**: The run completed.",
"text": "Everything worked as expected."
"text": "Everything worked as expected. You should see a logo above."
}
}
EOF
22 changes: 12 additions & 10 deletions .github/workflows/test-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Tests Validation
name: Integration Tests Check

# To trigger the check
on:
Expand All @@ -11,9 +11,10 @@ jobs:
permissions:
checks: write # Permission to create a Check Run
contents: write # Permission to write a repository_dispatch requests
actions: write
steps:
- name: Integration Tests Check
id: testcheck # An ID to allow the step to be referenced
- name: Create Check
id: checkrun # An ID to allow the step to be referenced
env:
GH_TOKEN: ${{ github.token }} # Expose the token for GH CLI
run: |
Expand All @@ -24,11 +25,12 @@ jobs:
CHECKID=$(gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f name='Integration Tests Check' \
-f name='Super Check' \
-f head_sha='${{ github.event.pull_request.head.sha }}' \
-f status='queued' \
-f 'output[title]=Integration Tests' \
-f 'output[summary]=Pending Integration Tests for Py SDK' \
-f 'output[title]=My Check Run Title' \
-f 'output[summary]=A *fancy* summary' \
-f 'output[text]=More detailed Markdown **text**' \
--jq '.id' \
/repos/${{ github.repository }}/check-runs)
Expand All @@ -38,7 +40,7 @@ jobs:
echo "checkId=$CHECKID" >> $GITHUB_OUTPUT
- name: Trigger Integration Tests
- name: Trigger
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -49,7 +51,7 @@ jobs:
gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'event_type=integration-check' \
-f 'client_payload[checkRunId]=${{ steps.testcheck.outputs.checkId }}' \
-f 'client_payload[checkRunId]=${{ steps.checkrun.outputs.checkId }}' \
-f 'client_payload[sha]=${{ github.sha }}' \
/repos/${{ github.repository }}/dispatches
-f "ref=run-tests" \
/repos/${{ github.repository }}/actions/workflows/integration.yml/dispatches

0 comments on commit 5b2ba08

Please sign in to comment.