Skip to content

fix: edge case where domain cardinality is 1 #595

fix: edge case where domain cardinality is 1

fix: edge case where domain cardinality is 1 #595

Workflow file for this run

on: pull_request
name: pull_request
jobs:
staticcheck:
runs-on: ubuntu-22.04-16core
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
- name: gofmt
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
- name: generated files should not be modified
run: |
go generate ./...
git update-index --assume-unchanged go.mod
git update-index --assume-unchanged go.sum
if [[ -n $(git status --porcelain) ]]; then echo "git repo is dirty after running go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi
# hack to ensure golanglint process generated files
- name: remove "generated by" comments from generated files
run: |
find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
# on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: -v --timeout=5m
skip-pkg-cache: true
test:
runs-on: ubuntu-22.04-16core
needs:
- staticcheck
permissions:
pull-requests: write
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: install deps
run: |
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
# 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 -short -timeout=30m ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
go test -json -v -tags=purego -timeout=30m ./... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -race -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
GOARCH=386 go test -json -short -v -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
- name: Generate job summary
run: |
cat /tmp/gotest.log | node .github/parse-tests.js > /tmp/gotest.md
cat /tmp/gotest.md > $GITHUB_STEP_SUMMARY
- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: /tmp/gotest.md
slack-workflow-status-failed:
if: failure()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "FAIL",
"title": "${{ github.event.pull_request.title }}",
"pr": "${{ github.event.pull_request.head.ref }}",
"failed_step_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
slack-workflow-status-success:
if: success()
name: post workflow status to slack
needs:
- staticcheck
- test
runs-on: ubuntu-latest
steps:
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"actor": "${{ github.actor }}",
"repo": "${{ github.repository }}",
"status": "SUCCESS",
"title": "${{ github.event.pull_request.title }}",
"pr": "${{ github.event.pull_request.head.ref }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }}