Skip to content

Commit

Permalink
Merge pull request #166 from ConsenSys/ci_new
Browse files Browse the repository at this point in the history
ci: new workflows
  • Loading branch information
gbotrel authored Mar 23, 2022
2 parents 0a5445a + d0c8473 commit e037f4a
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
on:
push:
branches:
- 'master'
- 'develop'
pull_request:
branches:
- 'master'
- 'develop'
name: CI
name: CI_develop
jobs:
staticcheck:
runs-on: ubuntu-latest
steps:
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
go-version: 1.18.x
- name: checkout code
uses: actions/checkout@v2
with:
Expand All @@ -38,11 +36,11 @@ jobs:
run: go vet ./...
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
go install honnef.co/go/tools/cmd/staticcheck@23e1086441d24fed9f668ad1cd4374245118b590
staticcheck ./...
- name: gosec
run: |
go install github.com/securego/gosec/cmd/gosec@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec -exclude="G204,G304" ./...
- name: generated files should not be modified
run: |
Expand All @@ -54,8 +52,8 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
needs:
- staticcheck
Expand All @@ -81,13 +79,10 @@ jobs:
- name: Test
run: |
go test -v -short ./...
go test -v -race -short ./...
go test -v -tags=noadx -short ./...
- name: Test (32bits)
if: matrix.os == 'ubuntu-latest'
run: |
GOARCH=386 go test -v -short ./ecc/bn254/...
GOARCH=386 go test -v -short ./ecc/bls12-381/...
slack-workflow-status:
if: always()
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/master.yml
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'

0 comments on commit e037f4a

Please sign in to comment.