-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from ConsenSys/ci_new
ci: new workflows
- Loading branch information
Showing
2 changed files
with
109 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
name: CI_master | ||
jobs: | ||
staticcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18.x | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- 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: go vet | ||
run: go vet ./... | ||
- name: staticcheck | ||
run: | | ||
go install honnef.co/go/tools/cmd/staticcheck@23e1086441d24fed9f668ad1cd4374245118b590 | ||
staticcheck ./... | ||
- name: gosec | ||
run: | | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
gosec -exclude="G204,G304" ./... | ||
- 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 runing go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x, 1.18.x] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- staticcheck | ||
steps: | ||
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: install deps | ||
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest | ||
- name: Test | ||
run: | | ||
go test -v ./... | ||
go test -v -race ./... | ||
go test -v -tags=noadx ./... | ||
- name: Test (32bits) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
GOARCH=386 go test -v ./ecc/bn254/... | ||
GOARCH=386 go test -v ./ecc/bls12-381/... | ||
slack-workflow-status: | ||
if: always() | ||
name: post workflow status to slack | ||
needs: | ||
- staticcheck | ||
- test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build notification | ||
uses: Gamesight/slack-workflow-status@master | ||
with: | ||
repo_token: ${{secrets.GITHUB_TOKEN}} | ||
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} | ||
channel: '#team-gnark-build' |