-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into deprecate-retries-feature
- Loading branch information
Showing
7 changed files
with
200 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# Cancel already running workflows if new ones are scheduled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
validation: | ||
uses: ./.github/workflows/validation.yml | ||
|
||
unit-tests: | ||
uses: ./.github/workflows/tox-test.yml | ||
|
||
# Produce a pull request payload artifact with various data about the | ||
# pull-request event (such as the PR number, title, author, ...). | ||
# This data is then be picked up by status-embed.yml action. | ||
pr_artifact: | ||
name: Produce Pull Request payload artifact | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Prepare Pull Request Payload artifact | ||
id: prepare-artifact | ||
if: always() && github.event_name == 'pull_request' | ||
continue-on-error: true | ||
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json | ||
|
||
- name: Upload a Build Artifact | ||
if: always() && steps.prepare-artifact.outcome == 'success' | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pull-request-payload | ||
path: pull_request_payload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ name: Status Embed | |
on: | ||
workflow_run: | ||
workflows: | ||
- Validation | ||
- Tox test | ||
- CI | ||
types: | ||
- completed | ||
|
||
|
@@ -14,7 +13,7 @@ concurrency: | |
|
||
jobs: | ||
status_embed: | ||
name: Send Status Embed to Discord | ||
name: Send Status Embed to Discord | ||
runs-on: ubuntu-latest | ||
steps: | ||
# A workflow_run event does not contain all the information | ||
|
@@ -27,13 +26,13 @@ jobs: | |
curl -s -H "Authorization: token $GITHUB_TOKEN" ${{ github.event.workflow_run.artifacts_url }} > artifacts.json | ||
DOWNLOAD_URL=$(cat artifacts.json | jq -r '.artifacts[] | select(.name == "pull-request-payload") | .archive_download_url') | ||
[ -z "$DOWNLOAD_URL" ] && exit 1 | ||
wget --quiet --header="Authorization: token $GITHUB_TOKEN" -O pull_request_payload.zip $DOWNLOAD_URL || exit 2 | ||
curl -sSL -H "Authorization: token $GITHUB_TOKEN" -o pull_request_payload.zip $DOWNLOAD_URL || exit 2 | ||
unzip -p pull_request_payload.zip > pull_request_payload.json | ||
[ -s pull_request_payload.json ] || exit 3 | ||
echo "::set-output name=pr_author_login::$(jq -r '.user.login // empty' pull_request_payload.json)" | ||
echo "::set-output name=pr_number::$(jq -r '.number // empty' pull_request_payload.json)" | ||
echo "::set-output name=pr_title::$(jq -r '.title // empty' pull_request_payload.json)" | ||
echo "::set-output name=pr_source::$(jq -r '.head.label // empty' pull_request_payload.json)" | ||
echo "pr_author_login=$(jq -r '.user.login // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT | ||
echo "pr_number=$(jq -r '.number // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT | ||
echo "pr_title=$(jq -r '.title // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT | ||
echo "pr_source=$(jq -r '.head.label // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -45,7 +44,7 @@ jobs: | |
uses: SebastiaanZ/[email protected] | ||
with: | ||
# Our GitHub Actions webhook | ||
webhook_id: '942940470059892796' | ||
webhook_id: "942940470059892796" | ||
webhook_token: ${{ secrets.webhook_token }} | ||
|
||
# We need to provide the information of the workflow that | ||
|
@@ -61,8 +60,3 @@ jobs: | |
pr_number: ${{ steps.pr_info.outputs.pr_number }} | ||
pr_title: ${{ steps.pr_info.outputs.pr_title }} | ||
pr_source: ${{ steps.pr_info.outputs.pr_source }} | ||
|
||
# And some additional details | ||
actor: ${{ github.actor }} | ||
repository: ${{ github.repository }} | ||
ref: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.