From 702c44ff6bbf27288b41fdb8e54dbbf82fa003b8 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:34:16 +0100 Subject: [PATCH 1/9] move some sims to github actions --- .circleci/config.yml | 47 --------------- .github/workflows/sims.yml | 117 +++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/sims.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 18d519cf9a..d684e5bcd4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,41 +86,6 @@ jobs: target: proto-gen proto-lint proto-check-breaking description: "Lint and verify Protocol Buffer definitions" - test-sim-nondeterminism: - executor: golang - steps: - - make: - target: test-sim-nondeterminism - description: "Test individual module simulations" - - test-sim-import-export: - executor: golang - steps: - - make: - target: test-sim-import-export - description: "Test application import/export simulation" - - test-sim-after-import: - executor: golang - steps: - - make: - target: test-sim-after-import - description: "Test simulation after import" - - test-sim-multi-seed-long: - executor: golang - steps: - - make: - target: test-sim-multi-seed-long - description: "Test multi-seed simulation (long)" - - test-sim-multi-seed-short: - executor: golang - steps: - - make: - target: test-sim-multi-seed-short - description: "Test multi-seed simulation (short)" - test-cover: executor: golang parallelism: 4 @@ -197,18 +162,6 @@ workflows: only: - /^v.*/ - proto: - requires: - - setup-dependencies - - test-sim-nondeterminism: - requires: - - setup-dependencies - - test-sim-import-export: - requires: - - setup-dependencies - - test-sim-after-import: - requires: - - setup-dependencies - - test-sim-multi-seed-short: requires: - setup-dependencies - test-sim-multi-seed-long: diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml new file mode 100644 index 0000000000..73f3de53a7 --- /dev/null +++ b/.github/workflows/sims.yml @@ -0,0 +1,117 @@ +name: Sims +on: [pull_request] +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/setup-go@v1 + id: go + with: + go-version: 1.14 + - name: Setup env for GO + # this is only used until the setup-go action is updated + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + echo "::set-env name=GO111MODULE::"on"" + shell: bash + - name: install runsim + run: | + 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-nondeterminism: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/setup-go@v1 + id: go + with: + go-version: 1.14 + - name: Setup env for GO + # this is only used until the setup-go action is updated + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test nondeterminism + run: | + make test-sim-nondeterminism + + test-sim-import-export: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/setup-go@v1 + id: go + with: + go-version: 1.14 + - name: Setup env for GO + # this is only used until the setup-go action is updated + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-import-export + run: | + make test-sim-import-export + + test-sim-after-import: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/setup-go@v1 + id: go + with: + go-version: 1.14 + - name: Setup env for GO + # this is only used until the setup-go action is updated + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test after import + run: | + make test-sim-import-export + + test-sim-multi-seed-short: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/setup-go@v1 + id: go + with: + go-version: 1.14 + - name: Setup env for GO + # this is only used until the setup-go action is updated + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-multi-seed-short + run: | + make test-sim-multi-seed-short From f7f8543dcbbdaf97d2cfc6061da479b182018eae Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:37:23 +0100 Subject: [PATCH 2/9] add back multi seed long --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d684e5bcd4..7acc251827 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,13 @@ jobs: target: proto-gen proto-lint proto-check-breaking description: "Lint and verify Protocol Buffer definitions" + test-sim-multi-seed-long: + executor: golang + steps: + - make: + target: test-sim-multi-seed-long + description: "Test multi-seed simulation (long)" + test-cover: executor: golang parallelism: 4 From 2be5378d2a8260b44b69d2f9ada85bc9434709c8 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:38:55 +0100 Subject: [PATCH 3/9] cleanup redundant ci --- .circleci/config.yml | 5 +---- .github/workflows/sims.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7acc251827..6e65eff6ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ executors: AWS_REGION: us-east-1 protoc: docker: - - image: tendermintdev/docker-protoc + - image: bufbuild/buf commands: make: @@ -79,9 +79,6 @@ jobs: proto: executor: protoc steps: - - make: - target: protoc-gen-gocosmos - description: "Generate go plugin for protoc" - make: target: proto-gen proto-lint proto-check-breaking description: "Lint and verify Protocol Buffer definitions" diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 73f3de53a7..d0b4b0fe7f 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -1,6 +1,14 @@ name: Sims on: [pull_request] 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')" From 72ceb5cc6c86557f8b103210442e8bc229aaa7ef Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:42:27 +0100 Subject: [PATCH 4/9] remove make from proto --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e65eff6ab..1d67adbdb1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,8 +79,10 @@ jobs: proto: executor: protoc steps: - - make: - target: proto-gen proto-lint proto-check-breaking + - checkout + - run: + name: proto check + command: make proto-lint && make proto-check-breaking description: "Lint and verify Protocol Buffer definitions" test-sim-multi-seed-long: @@ -165,9 +167,7 @@ workflows: tags: only: - /^v.*/ - - proto: - requires: - - setup-dependencies + - proto - test-sim-multi-seed-long: requires: - setup-dependencies From bb0922d56474ac3dffe26e6b1456dc8f454b8a0d Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:43:01 +0100 Subject: [PATCH 5/9] fix circle --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d67adbdb1..72223908da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,6 @@ jobs: - run: name: proto check command: make proto-lint && make proto-check-breaking - description: "Lint and verify Protocol Buffer definitions" test-sim-multi-seed-long: executor: golang From a4efd33488a4985f1ba3646de5f30c42726cba5e Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:46:24 +0100 Subject: [PATCH 6/9] move proto to github actions --- .circleci/config.yml | 8 -------- .github/workflows/proto.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/proto.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 72223908da..6a1cce30bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,13 +76,6 @@ jobs: key: go-src-v1-{{ .Revision }} paths: - ".git" - proto: - executor: protoc - steps: - - checkout - - run: - name: proto check - command: make proto-lint && make proto-check-breaking test-sim-multi-seed-long: executor: golang @@ -166,7 +159,6 @@ workflows: tags: only: - /^v.*/ - - proto - test-sim-multi-seed-long: requires: - setup-dependencies diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 0000000000..20615373f7 --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,12 @@ +name: Proto check +on: [pull_request] +jobs: + proto-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: docker-practice/actions-setup-docker@master + - name: lint + run: docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf check lint --error-format=json + - name: check-breakage + run: docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master From 2d459350487563253e695c39f817e5757bf214b7 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:48:30 +0100 Subject: [PATCH 7/9] remove shell --- .github/workflows/proto.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 20615373f7..9048c16072 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -7,6 +7,6 @@ jobs: - uses: actions/checkout@master - uses: docker-practice/actions-setup-docker@master - name: lint - run: docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf check lint --error-format=json + run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf check lint --error-format=json - name: check-breakage - run: docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master + run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master From db39408c447a2b67f3ffd2aca12da4154fc6df9c Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 15:51:04 +0100 Subject: [PATCH 8/9] test pwd --- .github/workflows/proto.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 9048c16072..3a8abb6328 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -6,7 +6,8 @@ jobs: steps: - uses: actions/checkout@master - uses: docker-practice/actions-setup-docker@master - - name: lint - run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf check lint --error-format=json - - name: check-breakage - run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master + - run: pwd + # - name: lint + # run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf check lint --error-format=json + # - name: check-breakage + # run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master From a495e7daee90acb3eb9487fd13ead1e17f13d1de Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 27 Mar 2020 16:04:55 +0100 Subject: [PATCH 9/9] revert proto changes --- .circleci/config.yml | 15 ++++++++++++++- .github/workflows/proto.yml | 13 ------------- 2 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/proto.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a1cce30bc..82ed61fb95 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ executors: AWS_REGION: us-east-1 protoc: docker: - - image: bufbuild/buf + - image: tendermintdev/docker-protoc commands: make: @@ -77,6 +77,16 @@ jobs: paths: - ".git" + proto: + executor: protoc + steps: + - make: + target: protoc-gen-gocosmos + description: "Generate go plugin for protoc" + - make: + target: proto-gen proto-lint proto-check-breaking + description: "Lint and verify Protocol Buffer definitions" + test-sim-multi-seed-long: executor: golang steps: @@ -172,6 +182,9 @@ workflows: - test-cover: requires: - setup-dependencies + - proto: + requires: + - setup-dependencies - upload-coverage: requires: - test-cover diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml deleted file mode 100644 index 3a8abb6328..0000000000 --- a/.github/workflows/proto.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Proto check -on: [pull_request] -jobs: - proto-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: docker-practice/actions-setup-docker@master - - run: pwd - # - name: lint - # run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf check lint --error-format=json - # - name: check-breakage - # run: docker run -v pwd:/workspace --workdir /workspace bufbuild/buf --against-input .git#branch=master