github.com/consensys/gnark@v0.11.0/.github/workflows/push.yml (about) 1 on: 2 push: 3 branches: 4 - 'master' 5 name: push_master 6 jobs: 7 staticcheck: 8 runs-on: ubuntu-latest 9 steps: 10 - name: checkout code 11 uses: actions/checkout@v4 12 with: 13 fetch-depth: 0 14 - name: install Go 15 uses: actions/setup-go@v5 16 with: 17 go-version: 1.23.x 18 19 - name: install deps 20 run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 21 - name: gofmt 22 run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi 23 - name: generated files should not be modified 24 run: | 25 go generate ./... 26 git update-index --assume-unchanged go.mod 27 git update-index --assume-unchanged go.sum 28 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 29 30 # hack to ensure golanglint process generated files 31 - name: remove "generated by" comments from generated files 32 run: | 33 find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \; 34 # on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \; 35 - name: golangci-lint 36 uses: golangci/golangci-lint-action@v6 37 with: 38 version: v1.60 39 args: -v --timeout=5m 40 41 test: 42 strategy: 43 matrix: 44 go-version: [1.23.x] 45 os: [ubuntu-latest-128, windows-latest, macos-latest] 46 runs-on: ${{ matrix.os }} 47 needs: 48 - staticcheck 49 steps: 50 - name: checkout code 51 uses: actions/checkout@v4 52 - name: install Go 53 uses: actions/setup-go@v5 54 with: 55 go-version: ${{ matrix.go-version }} 56 - name: install deps 57 run: | 58 go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 59 go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8 60 - name: install solc deps 61 if: startsWith(matrix.os, 'ubuntu') == true 62 run: | 63 go install github.com/consensys/gnark-solidity-checker@v0.1.0 64 sudo add-apt-repository ppa:ethereum/ethereum 65 sudo apt-get update 66 sudo apt-get install solc 67 68 - name: Test (windows / mac) 69 # on macOS CI / Windows CI we avoid running the std/ tests (they are run on ubuntu CI) 70 if: startsWith(matrix.os, 'ubuntu') == false 71 run: | 72 go test -tags=release_checks -v -timeout=60m . 73 - name: Test (ubuntu - race and solc) 74 if: startsWith(matrix.os, 'ubuntu') == true 75 run: | 76 go test -v -p 4 -short -timeout=30m ./... 77 go test -v -p 4 -timeout=120m -tags=release_checks ./std/math/emulated/... 78 go test -v -p 4 -timeout=120m -tags=release_checks ./std/lookup/... 79 go test -v -p 4 -tags=release_checks,solccheck . 80 go test -v -p 4 -timeout=50m -tags=release_checks -race ./examples/cubic/... 81 go test -v -p 4 -timeout=50m -tags=release_checks -short -race ./test/... 82 go test -v -run=NONE -fuzz=FuzzIntcomp -fuzztime=30s ./internal/backend/ioutils 83 84 85 slack-workflow-status-failed: 86 if: failure() 87 name: post workflow status to slack 88 needs: 89 - staticcheck 90 - test 91 runs-on: ubuntu-latest 92 steps: 93 - name: Notify slack -- workflow failed 94 id: slack 95 uses: slackapi/slack-github-action@v1.26.0 96 with: 97 payload: | 98 { 99 "actor": "${{ github.actor }}", 100 "repo": "${{ github.repository }}", 101 "status": "FAIL", 102 "title": "push to master ⚠", 103 "pr": "", 104 "failed_step_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/", 105 "message": "" 106 } 107 env: 108 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 109 110 slack-workflow-status-success: 111 if: success() 112 name: post workflow status to slack 113 needs: 114 - staticcheck 115 - test 116 runs-on: ubuntu-latest 117 steps: 118 - name: Notify slack -- workflow succeeded 119 id: slack 120 uses: slackapi/slack-github-action@v1.26.0 121 with: 122 payload: | 123 { 124 "actor": "${{ github.actor }}", 125 "repo": "${{ github.repository }}", 126 "status": "SUCCESS", 127 "title": "push to master ✅", 128 "pr": "" 129 } 130 env: 131 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }}