ci: migrate long sims (#6084)
Cancel ci if no .go files have been touched. There is no clean way of doing this so i opted to `exit 1` on the diff job if no go files were changed and have builds depend on diff passing - migrate proto checks to github actions. - providing make commands to use buf within docker. - test-sim-multi-seed-long migration to github actions. Follows same logic and only runs on release branches. - add protobuf section to CONTRIBUTING.md.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
name: Proto check
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
proto-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
id: git_diff
|
||||
with:
|
||||
SUFFIX_FILTER: .proto
|
||||
SET_ENV_NAME_INSERTIONS: 1
|
||||
SET_ENV_NAME_LINES: 1
|
||||
- name: lint
|
||||
run: make proto-lint-docker
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- name: check-breakage
|
||||
run: make proto-check-breaking-docker
|
||||
if: "env.GIT_DIFF != ''"
|
||||
@@ -0,0 +1,47 @@
|
||||
name: Release Sims
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- /^v.*/
|
||||
|
||||
jobs:
|
||||
cleanup-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'skip-sims')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
make build
|
||||
|
||||
install-runsim:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: install runsim
|
||||
run: |
|
||||
export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/runsim@v1.0.0
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: ${{ runner.os }}-go-runsim-binary
|
||||
|
||||
test-sim-multi-seed-long:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, install-runsim]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: ${{ runner.os }}-go-runsim-binary
|
||||
- name: test-sim-multi-seed-long
|
||||
run: |
|
||||
make test-sim-multi-seed-long
|
||||
+25
-11
@@ -1,25 +1,43 @@
|
||||
name: Sims
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
diff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
id: git_diff
|
||||
with:
|
||||
SUFFIX_FILTER: |
|
||||
.go
|
||||
.mod
|
||||
.sum
|
||||
SET_ENV_NAME_INSERTIONS: 1
|
||||
SET_ENV_NAME_LINES: 1
|
||||
- name: Fail if no changes
|
||||
# this is used to notify the other jobs that there are no changes and so they should not run
|
||||
run: exit 1
|
||||
if: "env.GIT_DIFF == ''"
|
||||
|
||||
cleanup-runs:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'skip-sims')"
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
make build
|
||||
|
||||
install-runsim:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
needs: [build, diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- name: install runsim
|
||||
@@ -32,9 +50,8 @@ jobs:
|
||||
|
||||
test-sim-nondeterminism:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, install-runsim]
|
||||
needs: [build, install-runsim, diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
@@ -46,9 +63,8 @@ jobs:
|
||||
|
||||
test-sim-import-export:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, install-runsim]
|
||||
needs: [build, install-runsim, diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
@@ -60,9 +76,8 @@ jobs:
|
||||
|
||||
test-sim-after-import:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, install-runsim]
|
||||
needs: [build, install-runsim, diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
@@ -74,9 +89,8 @@ jobs:
|
||||
|
||||
test-sim-multi-seed-short:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, install-runsim]
|
||||
needs: [build, install-runsim, diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
|
||||
@@ -18,12 +18,21 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
id: git_diff
|
||||
with:
|
||||
SUFFIX_FILTER: |
|
||||
.go
|
||||
.mod
|
||||
.sum
|
||||
- name: build
|
||||
run: |
|
||||
make build
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- name: test & coverage report creation
|
||||
run: |
|
||||
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- name: filter out DONTCOVER
|
||||
run: |
|
||||
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
|
||||
@@ -34,7 +43,9 @@ jobs:
|
||||
echo "Excluding ${filename} from coverage report..."
|
||||
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
|
||||
done
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- uses: codecov/codecov-action@v1
|
||||
with:
|
||||
file: ./coverage.txt # optional
|
||||
fail_ci_if_error: true
|
||||
if: "env.GIT_DIFF != ''"
|
||||
|
||||
Reference in New Issue
Block a user