-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into VRF-797-remove-oracle-withdraw-and-allow-…
…contract-owner-to-withdraw
- Loading branch information
Showing
490 changed files
with
9,140 additions
and
5,075 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See: https://github.com/helm/chart-testing | ||
target-branch: develop | ||
chart-dirs: 'charts' | ||
check-version-increment: false | ||
validate-maintainers: false |
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,37 @@ | ||
# Notify Slack Jobs Result | ||
|
||
Sends a Slack message to a specified channel detailing the results of one to many GHA job results using a regex. The job results will be grouped by the `github_job_name_regex` and displayed underneath the `message_title`, with the regex matching group displayed as an individual result. This is primarily designed for when you have test groups running in a matrix, and would like condensed reporting on their status by group. It's often accompanied by posting a Slack message before to start a thread, then attaching all the results to that thread like we do in the reporting section of the [live-testnet-test.yml workflow](../../workflows/live-testnet-tests.yml). Check out the example below, where we post an initial summary message, then use this action to thread together specific results: | ||
|
||
```yaml | ||
message_title: Optimism Goerli | ||
github_job_name_regex: ^Optimism Goerli (?<cap>.*?) Tests$ # Note that the regex MUST have a capturing group named "cap" | ||
``` | ||
![example](image.png) | ||
## Inputs | ||
```yaml | ||
inputs: | ||
github_token: | ||
description: "The GitHub token to use for authentication (usually ${{ github.token }})" | ||
required: true | ||
github_repository: | ||
description: "The GitHub owner/repository to use for authentication (usually ${{ github.repository }}))" | ||
required: true | ||
workflow_run_id: | ||
description: "The workflow run ID to get the results from (usually ${{ github.run_id }})" | ||
required: true | ||
github_job_name_regex: | ||
description: "The regex to use to match 1..many job name(s) to collect results from. Should include a capture group named 'cap' for the part of the job name you want to display in the Slack message (e.g. ^Client Compatability Test (?<cap>.*?)$)" | ||
required: true | ||
message_title: | ||
description: "The title of the Slack message" | ||
required: true | ||
slack_channel_id: | ||
description: "The Slack channel ID to post the message to" | ||
required: true | ||
slack_thread_ts: | ||
description: "The Slack thread timestamp to post the message to, handy for keeping multiple related results in a single thread" | ||
required: false | ||
``` |
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,110 @@ | ||
name: Notify Slack Jobs Result | ||
description: Will send a notification in Slack for the result of a GitHub action run, typically for test results | ||
inputs: | ||
github_token: | ||
description: "The GitHub token to use for authentication (usually github.token)" | ||
required: true | ||
github_repository: | ||
description: "The GitHub owner/repository to use for authentication (usually github.repository))" | ||
required: true | ||
workflow_run_id: | ||
description: "The workflow run ID to get the results from (usually github.run_id)" | ||
required: true | ||
github_job_name_regex: | ||
description: "The regex to use to match 1..many job name(s) to collect results from. Should include a capture group named 'cap' for the part of the job name you want to display in the Slack message (e.g. ^Client Compatability Test (?<cap>.*?)$)" | ||
required: true | ||
message_title: | ||
description: "The title of the Slack message" | ||
required: true | ||
slack_channel_id: | ||
description: "The Slack channel ID to post the message to" | ||
required: true | ||
slack_bot_token: | ||
description: "The Slack bot token to use for authentication which needs permission and an installed app in the channel" | ||
required: true | ||
slack_thread_ts: | ||
description: "The Slack thread timestamp to post the message to, handy for keeping multiple related results in a single thread" | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get Results | ||
shell: bash | ||
id: test-results | ||
run: | | ||
# I feel like there's some clever, fully jq way to do this, but I ain't got the motivation to figure it out | ||
echo "Querying test results at https://api.github.com/repos/${{inputs.github_repository}}/actions/runs/${{ inputs.workflow_run_id }}/jobs" | ||
PARSED_RESULTS=$(curl \ | ||
-H "Authorization: Bearer ${{ inputs.github_token }}" \ | ||
'https://api.github.com/repos/${{inputs.github_repository}}/actions/runs/${{ inputs.workflow_run_id }}/jobs' \ | ||
| jq -r --arg pattern "${{ inputs.github_job_name_regex }}" '.jobs[] | ||
| select(.name | test($pattern)) as $job | ||
| $job.steps[] | ||
| select(.name == "Run Tests") | ||
| { conclusion: (if .conclusion == "success" then ":white_check_mark:" else ":x:" end), cap: ("*" + ($job.name | capture($pattern).cap) + "*"), html_url: $job.html_url }') | ||
echo "Parsed Results:" | ||
echo $PARSED_RESULTS | ||
ALL_SUCCESS=true | ||
echo "Checking for failures" | ||
echo "$PARSED_RESULTS" | jq -s | jq -r '.[] | select(.conclusion != ":white_check_mark:")' | ||
for row in $(echo "$PARSED_RESULTS" | jq -s | jq -r '.[] | select(.conclusion != ":white_check_mark:")'); do | ||
ALL_SUCCESS=false | ||
break | ||
done | ||
echo "Success: $ALL_SUCCESS" | ||
echo all_success=$ALL_SUCCESS >> $GITHUB_OUTPUT | ||
FORMATTED_RESULTS=$(echo $PARSED_RESULTS | jq -s '[.[] | ||
| { | ||
conclusion: .conclusion, | ||
cap: .cap, | ||
html_url: .html_url | ||
} | ||
] | ||
| map("{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"<\(.html_url)|\(.cap)>: \(.conclusion)\"}}") | ||
| join(",")') | ||
echo "Formatted Results:" | ||
echo $FORMATTED_RESULTS | ||
# Cleans out backslashes and quotes from jq | ||
CLEAN_RESULTS=$(echo "$FORMATTED_RESULTS" | sed 's/\\\"/"/g' | sed 's/^"//;s/"$//') | ||
echo "Clean Results" | ||
echo $CLEAN_RESULTS | ||
echo results=$CLEAN_RESULTS >> $GITHUB_OUTPUT | ||
- name: Post Results | ||
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 | ||
env: | ||
SLACK_BOT_TOKEN: ${{ inputs.slack_bot_token }} | ||
with: | ||
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"thread_ts": "${{ inputs.slack_thread_ts }}", | ||
"attachments": [ | ||
{ | ||
"color": "${{ steps.test-results.outputs.all_success == 'true' && '#2E7D32' || '#C62828' }}", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "${{ inputs.message_title }} ${{ steps.test-results.outputs.all_success == 'true' && ':white_check_mark:' || ':x:'}}", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
${{ steps.test-results.outputs.results }} | ||
] | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
name: CI Scripts | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
lint-scripts: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Golang Lint | ||
uses: ./.github/actions/golangci-lint | ||
with: | ||
name: lint-scripts | ||
go-directory: core/scripts | ||
go-version-file: core/scripts/go.mod | ||
go-module-file: core/scripts/go.sum | ||
gc-basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} | ||
gc-host: ${{ secrets.GRAFANA_CLOUD_HOST }} | ||
|
||
test-scripts: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Setup Go | ||
uses: ./.github/actions/setup-go | ||
with: | ||
go-version-file: core/scripts/go.mod | ||
go-module-file: core/scripts/go.sum | ||
- name: Run Tests | ||
shell: bash | ||
working-directory: core/scripts | ||
run: go test ./... | ||
- name: Collect Metrics | ||
if: always() | ||
id: collect-gha-metrics | ||
uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2 | ||
with: | ||
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} | ||
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} | ||
this-job-name: test-scripts | ||
continue-on-error: true |
Oops, something went wrong.