Skip to content

Commit 2bb5f09

Browse files
authored
docs: update README.md (#1712)
1 parent c1528db commit 2bb5f09

File tree

12 files changed

+265
-134
lines changed

12 files changed

+265
-134
lines changed

.github/workflows/pr.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ jobs:
2727
go-version: ${{ env.GO_VERSION }}
2828
cache: true
2929

30-
- name: install deps
31-
run: |
32-
go install golang.org/x/tools/cmd/goimports@${{ env.GOIMPORTS_VERSION }}
33-
go install github.com/klauspost/asmfmt/cmd/asmfmt@${{ env.ASMFMT_VERSION }}
3430
- name: gofmt
3531
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
3632
- name: goimports
37-
run: if [[ -n $(goimports -l .) ]]; then echo "please run goimports"; exit 1; fi
33+
run: if [[ -n $(go tool goimports -l .) ]]; then echo "please run goimports"; exit 1; fi
3834
- name: generated files should not be modified
3935
run: |
4036
go generate ./...
@@ -67,8 +63,6 @@ jobs:
6763

6864
- name: install deps
6965
run: |
70-
go install golang.org/x/tools/cmd/goimports@${{ env.GOIMPORTS_VERSION }}
71-
go install github.com/klauspost/asmfmt/cmd/asmfmt@${{ env.ASMFMT_VERSION }}
7266
go install github.com/consensys/gnark-solidity-checker@v0.1.0
7367
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8
7468
sudo add-apt-repository ppa:ethereum/ethereum
@@ -86,8 +80,21 @@ jobs:
8680
- name: Run tests
8781
run: |
8882
set -euo pipefail
89-
go test -json -v -p 4 -short -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
90-
go test -json -v -p 4 -timeout=30m -tags=release_checks,solccheck . 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
91-
go test -json -v -p 4 -timeout=30m -tags=prover_checks ./test/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
92-
go test -json -v -p 4 -timeout=30m -tags=prover_checks ./examples/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
93-
go test -json -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=30s ./internal/backend/ioutils 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
83+
go test -short -json -v -p 4 -short -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
84+
go test -short -json -v -p 4 -timeout=30m -tags=release_checks,solccheck . 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
85+
go test -short -json -v -p 4 -timeout=30m -tags=prover_checks ./test/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
86+
go test -short -json -v -p 4 -timeout=30m -tags=prover_checks ./examples/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
87+
go test -short -json -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=10s ./internal/backend/ioutils 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
88+
89+
notify:
90+
needs: test
91+
if: always()
92+
uses: ./.github/workflows/slack-notifications.yml
93+
with:
94+
status: ${{ needs.test.result == 'success' && 'success' || 'failure' }}
95+
actor: ${{ github.actor }}
96+
repository: ${{ github.repository }}
97+
branch: ${{ github.head_ref }}
98+
run_id: ${{ github.run_id }}
99+
secrets:
100+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/push.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ permissions:
1313

1414
env:
1515
GO_VERSION: 1.25.x
16-
GOIMPORTS_VERSION: v0.42.0
17-
ASMFMT_VERSION: v1.3.2
1816

1917
jobs:
2018
staticcheck:
@@ -30,14 +28,10 @@ jobs:
3028
go-version: ${{ env.GO_VERSION }}
3129
cache: true
3230

33-
- name: install deps
34-
run: |
35-
go install golang.org/x/tools/cmd/goimports@${{ env.GOIMPORTS_VERSION }}
36-
go install github.com/klauspost/asmfmt/cmd/asmfmt@${{ env.ASMFMT_VERSION }}
3731
- name: gofmt
3832
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
3933
- name: goimports
40-
run: if [[ -n $(goimports -l .) ]]; then echo "please run goimports"; exit 1; fi
34+
run: if [[ -n $(go tool goimports -l .) ]]; then echo "please run goimports"; exit 1; fi
4135
- name: generated files should not be modified
4236
run: |
4337
go generate ./...
@@ -80,8 +74,6 @@ jobs:
8074
cache: true
8175
- name: install deps
8276
run: |
83-
go install golang.org/x/tools/cmd/goimports@${{ env.GOIMPORTS_VERSION }}
84-
go install github.com/klauspost/asmfmt/cmd/asmfmt@${{ env.ASMFMT_VERSION }}
8577
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8
8678
- name: install solc deps
8779
if: startsWith(matrix.os, 'gha-runner-scale-set-ubuntu') == true
@@ -106,3 +98,16 @@ jobs:
10698
go test -v -p 4 -timeout=50m -tags=release_checks -race ./examples/cubic/...
10799
go test -v -p 4 -timeout=50m -tags=release_checks -short -race ./test/...
108100
go test -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=30s ./internal/backend/ioutils
101+
102+
notify:
103+
needs: test
104+
if: always()
105+
uses: ./.github/workflows/slack-notifications.yml
106+
with:
107+
status: ${{ needs.test.result == 'success' && 'success' || 'failure' }}
108+
actor: ${{ github.actor }}
109+
repository: ${{ github.repository }}
110+
branch: ${{ github.ref_name }}
111+
run_id: ${{ github.run_id }}
112+
secrets:
113+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Slack Notifications
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
SLACK_BOT_TOKEN:
7+
required: true
8+
inputs:
9+
status:
10+
description: 'The status of the workflow (success or failure)'
11+
required: true
12+
type: string
13+
actor:
14+
description: 'The GitHub actor'
15+
required: true
16+
type: string
17+
repository:
18+
description: 'The GitHub repository'
19+
required: true
20+
type: string
21+
branch:
22+
description: 'The branch name'
23+
required: true
24+
type: string
25+
run_id:
26+
description: 'The workflow run ID'
27+
required: true
28+
type: string
29+
30+
jobs:
31+
notify_slack:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Post to Slack
35+
run: |
36+
if [ "${{ inputs.status }}" == "success" ]; then
37+
payload=$(jq -n --arg repository "${{ inputs.repository }}" --arg branch "${{ inputs.branch }}" --arg actor "${{ inputs.actor }}" --arg run_id "${{ inputs.run_id }}" '{
38+
"channel": "team-gnark-build",
39+
"text": "GitHub Action build result: success",
40+
"blocks": [
41+
{
42+
"type": "section",
43+
"text": {
44+
"type": "mrkdwn",
45+
"text": ":large_green_circle: *All checks have passed:* *\($branch)* :white_check_mark:"
46+
},
47+
},
48+
{
49+
"type": "context",
50+
"elements": [
51+
{
52+
"type": "mrkdwn",
53+
"text": "\($repository) -- \($actor) -- <https://github.com/\($repository)/actions/runs/\($run_id)|View details>"
54+
}
55+
]
56+
}
57+
]
58+
}')
59+
else
60+
payload=$(jq -n --arg repository "${{ inputs.repository }}" --arg branch "${{ inputs.branch }}" --arg actor "${{ inputs.actor }}" --arg run_id "${{ inputs.run_id }}" '{
61+
"channel": "team-gnark-build",
62+
"text": "GitHub Action build result: failure",
63+
"blocks": [
64+
{
65+
"type": "section",
66+
"text": {
67+
"type": "mrkdwn",
68+
"text": ":red_circle: *Failed run:* *\($branch)*"
69+
},
70+
},
71+
{
72+
"type": "context",
73+
"elements": [
74+
{
75+
"type": "mrkdwn",
76+
"text": "\($repository) -- \($actor) -- <https://github.com/\($repository)/actions/runs/\($run_id)|View details>"
77+
}
78+
]
79+
}
80+
]
81+
}')
82+
fi
83+
response=$(curl -s -X POST -H 'Content-type: application/json; charset=utf-8' --data "$payload" https://slack.com/api/chat.postMessage -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" )
84+
shell: bash

0 commit comments

Comments
 (0)