Skip to content

Commit

Permalink
Run other workflows after the Nix build has completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirTalwar committed Nov 2, 2023
1 parent 3b4b899 commit 83596ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
on: [push]
on:
workflow_run:
workflows:
- nix build
types:
- completed

name: Postgres NDC component benchmarks

Expand Down
32 changes: 9 additions & 23 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: E2E release compatibility

on:
push:
workflow_run:
workflows:
- nix build
types:
- completed
branches:
- main

Expand All @@ -16,37 +20,19 @@ jobs:
# pull requests create a new merge commit so we have to work our way back
# to the actual commit so it matches the Docker image
- name: Generate short SHA
id: short-git-hash
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
fi
echo "hash=$(git rev-parse --short=9 "$GITHUB_SHA")" >> $GITHUB_OUTPUT
id: short-git-hash

- name: Wait for Docker image to be created
uses: lewagon/[email protected]
with:
ref: "${{ github.event.pull_request.head.sha || github.sha }}"
check-name: "build and deploy (ndc-postgres)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Dispatch E2E tests
uses: aurelien-baudet/workflow-dispatch@v2
uses: benc-uk/workflow-dispatch@v1.2.2
id: workflow_dispatch
with:
inputs: '{ "connector": "${{ steps.short-git-hash.outputs.hash }}" }'
repo: hasura/v3-e2e-testing
ref: main
token: ${{ secrets.E2E_WORKFLOW_PAT }}
workflow: "cargo test postgres"

- name: Report failures
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "${{ github.event.head_commit.author.name }}, *saddle up*! The following commit to <{repo_url}|{repo}> broke the end-to-end tests:"
message_format: "${{ github.event.head_commit.message }}"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}
inputs: '{"connector": "${{ steps.short-git-hash.outputs.hash }}"}'
token: ${{ secrets.E2E_WORKFLOW_PAT }}

0 comments on commit 83596ce

Please sign in to comment.