Skip to content

Commit

Permalink
build: ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Sep 13, 2024
1 parent 506920b commit b475d7d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 50 deletions.
95 changes: 47 additions & 48 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,62 +35,61 @@ jobs:
version: v1.60
args: -v --timeout=5m

test:
runs-on: ubuntu-latest-128
permissions:
pull-requests: write
outputs:
failures: ${{ steps.generate-job-summary.outputs.failures }}
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.x
# test:
# runs-on: ubuntu-latest-128
# permissions:
# pull-requests: write
# outputs:
# failures: ${{ steps.generate-job-summary.outputs.failures }}
# steps:
# - name: checkout code
# uses: actions/checkout@v4
# - name: install Go
# uses: actions/setup-go@v5
# with:
# go-version: 1.23.x

- name: install deps
run: |
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
go install github.com/consensys/[email protected]
go install github.com/ethereum/go-ethereum/cmd/[email protected]
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
# - name: install deps
# run: |
# go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
# go install github.com/consensys/[email protected]
# go install github.com/ethereum/go-ethereum/cmd/[email protected]
# sudo add-apt-repository ppa:ethereum/ethereum
# sudo apt-get update
# sudo apt-get install solc

# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
# # Install gotestfmt on the VM running the action.
# - name: Set up gotestfmt
# uses: gotesttools/gotestfmt-action@v2
# with:
# # Optional: pass GITHUB_TOKEN to avoid rate limiting.
# token: ${{ secrets.GITHUB_TOKEN }}

# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run tests
run: |
set -euo pipefail
go test -json -v -p 4 -short -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
go test -json -v -p 4 -tags=release_checks,solccheck . 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
go test -json -v -p 4 -tags=prover_checks ./test/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
go test -json -v -p 4 -tags=prover_checks ./examples/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
go test -json -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=30s ./internal/backend/ioutils 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
# # Run tests with nice formatting. Save the original log in /tmp/gotest.log
# - name: Run tests
# run: |
# set -euo pipefail
# go test -json -v -p 4 -short -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
# go test -json -v -p 4 -tags=release_checks,solccheck . 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
# go test -json -v -p 4 -tags=prover_checks ./test/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
# go test -json -v -p 4 -tags=prover_checks ./examples/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
# go test -json -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=30s ./internal/backend/ioutils 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log

- name: Generate job summary
id: generate-job-summary
if: ${{ always() }}
run: |
if [ -s /tmp/gotest.log ]; then
cat /tmp/gotest.log > $GITHUB_STEP_SUMMARY
echo "failures=$(cat /tmp/gotest.log | node .github/parse-tests.js)" > $GITHUB_OUTPUT
else
echo "## Success ✅" > $GITHUB_STEP_SUMMARY
echo "failures=" > $GITHUB_OUTPUT
fi
# - name: Generate job summary
# id: generate-job-summary
# if: ${{ always() }}
# run: |
# if [ -s /tmp/gotest.log ]; then
# cat /tmp/gotest.log > $GITHUB_STEP_SUMMARY
# echo "failures=$(cat /tmp/gotest.log | node .github/parse-tests.js)" > $GITHUB_OUTPUT
# else
# echo "## Success ✅" > $GITHUB_STEP_SUMMARY
# echo "failures=" > $GITHUB_OUTPUT
# fi

slack-notifications:
if: always()
needs:
- staticcheck
- test
uses: ./.github/workflows/slack-notifications.yml
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Notify Slack
run: |
if [[ "${{ inputs.status }}" == "success" ]]; then
SLACK_MESSAGE=$(cat <<-EOF
SLACK_MESSAGE=$(cat <<EOF
{
"channel": "#team-gnark-build",
"blocks": [
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
EOF
)
else
SLACK_MESSAGE=$(cat <<-EOF
SLACK_MESSAGE=$(cat <<EOF
{
"blocks": [
{
Expand Down

0 comments on commit b475d7d

Please sign in to comment.