diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 68c752c2a..0f283a5e0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,6 +22,10 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + args: --timeout=5m - name: install deps run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest - name: gofmt @@ -74,17 +78,46 @@ jobs: run: | go test -v -short -timeout=30m ./... - slack-workflow-status: - if: always() + 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/slack-github-action@v1.19.0 + with: + payload: | + { + "actor": "${{ github.actor }}", + "repo": "${{ github.repository }}", + "status": "FAIL", + "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + } + 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: Build notification - uses: Gamesight/slack-workflow-status@master + - name: Notify slack -- workflow succeeded + id: slack + uses: slackapi/slack-github-action@v1.19.0 with: - repo_token: ${{secrets.GITHUB_TOKEN}} - slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} - channel: '#team-gnark-build' \ No newline at end of file + payload: | + { + "actor": "${{ github.actor }}", + "repo": "${{ github.repository }}", + "status": "SUCCESS", + "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }} \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 417e66655..03cb72489 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -26,6 +26,10 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + args: --timeout=5m - name: install deps run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest - name: gofmt @@ -82,17 +86,46 @@ jobs: run: | go test -v -timeout=50m -race -short ./... - slack-workflow-status: - if: always() + 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/slack-github-action@v1.19.0 + with: + payload: | + { + "actor": "${{ github.actor }}", + "repo": "${{ github.repository }}", + "status": "FAIL", + "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + } + 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: Build notification - uses: Gamesight/slack-workflow-status@master + - name: Notify slack -- workflow succeeded + id: slack + uses: slackapi/slack-github-action@v1.19.0 with: - repo_token: ${{secrets.GITHUB_TOKEN}} - slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} - channel: '#team-gnark-build' \ No newline at end of file + payload: | + { + "actor": "${{ github.actor }}", + "repo": "${{ github.repository }}", + "status": "SUCCESS", + "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }} \ No newline at end of file diff --git a/backend/groth16/bellman_test.go b/backend/groth16/bellman_test.go index 686f0d818..f53fd4950 100644 --- a/backend/groth16/bellman_test.go +++ b/backend/groth16/bellman_test.go @@ -107,7 +107,7 @@ func TestVerifyBellmanProof(t *testing.T) { // verify groth16 proof // we need to prepend the number of elements in the witness. var buf bytes.Buffer - binary.Write(&buf, binary.BigEndian, uint32(len(inputsBytes)/(fr.Limbs*8))) + _ = binary.Write(&buf, binary.BigEndian, uint32(len(inputsBytes)/(fr.Limbs*8))) buf.Write(inputsBytes) witness := &witness.Witness{ diff --git a/frontend/compiled/term.go b/frontend/compiled/term.go index 08148636e..278d81e73 100644 --- a/frontend/compiled/term.go +++ b/frontend/compiled/term.go @@ -56,7 +56,6 @@ const ( const TermDelimitor Term = Term(maskDelimitor) const ( - shiftWireID = 0 shiftCoeffID = nbBitsWireID shiftDelimitor = shiftCoeffID + nbBitsCoeffID shiftFutureUse = shiftDelimitor + nbBitsDelimitor @@ -67,7 +66,7 @@ const ( maskWireID = uint64((1 << nbBitsWireID) - 1) maskCoeffID = uint64((1< - ccs.IsSolved(&witness.Witness{}) + _ = ccs.IsSolved(&witness.Witness{}) }