From e51a523e3cb6316510acf3f7067e94cd86d1a5dd Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:00:47 +0100 Subject: [PATCH 01/11] build(ci): report status of optional jobs --- .github/workflows/pr-precheck.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pr-precheck.yml diff --git a/.github/workflows/pr-precheck.yml b/.github/workflows/pr-precheck.yml new file mode 100644 index 000000000..791a19a12 --- /dev/null +++ b/.github/workflows/pr-precheck.yml @@ -0,0 +1,24 @@ +--- +name: Wait for optional jobs + +on: + workflow_run: + workflows: + - "Check generated code" + + types: + - completed + +jobs: + wait-for-optional-jobs: + runs-on: ubuntu-latest + steps: + - name: Check status of optional jobs + shell: bash + run: | + if [[ "${{ github.event.workflow_run.conclusion }}" == "success" || "${{ github.event.workflow_run.conclusion }}" == "skipped" ]]; then + echo "All optional jobs passed or were skipped." + else + echo "Some optional jobs failed." + exit 1 + fi From 6c4b935237a5646b05417d5398414a04d35e974a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:47:10 +0100 Subject: [PATCH 02/11] chore: revert old approach --- .github/workflows/pr-precheck.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/pr-precheck.yml diff --git a/.github/workflows/pr-precheck.yml b/.github/workflows/pr-precheck.yml deleted file mode 100644 index 791a19a12..000000000 --- a/.github/workflows/pr-precheck.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Wait for optional jobs - -on: - workflow_run: - workflows: - - "Check generated code" - - types: - - completed - -jobs: - wait-for-optional-jobs: - runs-on: ubuntu-latest - steps: - - name: Check status of optional jobs - shell: bash - run: | - if [[ "${{ github.event.workflow_run.conclusion }}" == "success" || "${{ github.event.workflow_run.conclusion }}" == "skipped" ]]; then - echo "All optional jobs passed or were skipped." - else - echo "Some optional jobs failed." - exit 1 - fi From bbeab11230fab25a9589d9e309a0ae7726ce1e77 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:47:51 +0100 Subject: [PATCH 03/11] check-proto, check-mocks --- .github/workflows/check-generated.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index f49ee9ce1..a00eb9a12 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -26,8 +26,16 @@ jobs: go-version: "1.23.2" - uses: actions/checkout@v4 + with: + fetch-depth: 1 # we need a .git directory to run git diff + + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + **/*.go - name: "Check generated mocks" + if: env.GIT_DIFF run: | set -euo pipefail @@ -55,7 +63,13 @@ jobs: with: fetch-depth: 1 # we need a .git directory to run git diff + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + **/*.proto + - name: "Check protobuf generated code" + if: env.GIT_DIFF run: | set -euo pipefail From 9af716e37ce454015ffc177ea3217da1cb2103c6 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:48:45 +0100 Subject: [PATCH 04/11] chore: remove paths --- .github/workflows/check-generated.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index a00eb9a12..92ee8132d 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -6,9 +6,6 @@ name: Check generated code on: pull_request: - paths: - - "**.go" - - "**.proto" push: branches: - master From 2e958fcc56389ad571274c6e624a47b083821fdc Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:03:52 +0100 Subject: [PATCH 05/11] build: replace on pull request paths with technote-space/get-diff-action@v6 --- .github/workflows/e2e.yml | 6 ++---- .github/workflows/lint.yml | 20 +++++++++++--------- .github/workflows/tests.yml | 13 ++++++++----- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d38c13e78..eacee2225 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -5,10 +5,6 @@ name: e2e on: workflow_dispatch: # allow running workflow manually pull_request: - paths: - - "**Dockerfile" - - "**.go" - - "go.sum" push: branches: - master @@ -40,7 +36,9 @@ jobs: - uses: technote-space/get-diff-action@v6 with: PATTERNS: | + **/Dockerfile **/**.go + FILES: | go.mod go.sum diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5644aeab1..cdc5ddfd5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,10 +9,6 @@ name: Golang Linter on: pull_request: - paths: - - "**.go" - - ".golangci.yml" - - ".github/linters/*" push: branches: - master @@ -30,25 +26,32 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - uses: actions/setup-go@v5.1.0 - with: - go-version: "^1.23.2" + - uses: technote-space/get-diff-action@v6 with: PATTERNS: | **/**.go + .github/linters/* + FILES: | go.mod go.sum .golangci.yml + - uses: actions/setup-go@v5.1.0 + if: env.GIT_DIFF + with: + go-version: "^1.23.2" + - name: Install dependencies + if: env.GIT_DIFF run: sudo apt-get update && sudo apt-get install -y libpcap-dev - uses: ./.github/actions/bls + if: env.GIT_DIFF name: Install BLS library - if: "env.GIT_DIFF != ''" - uses: golangci/golangci-lint-action@v6.1.1 + if: env.GIT_DIFF with: # Required: the version of golangci-lint is required and # must be specified without patch version: we always use the @@ -57,4 +60,3 @@ jobs: args: --timeout 10m github-token: ${{ secrets.github_token }} only-new-issues: true - if: env.GIT_DIFF diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7300760a4..0a4f75472 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,6 @@ name: Test on: pull_request: - paths: - - "**.go" - - "go.sum" push: branches: - master @@ -26,20 +23,26 @@ jobs: PATTERNS: | **/**.go "!test/" + FILES: | go.mod go.sum Makefile + - name: Install libpcap + if: env.GIT_DIFF run: sudo apt-get install --yes libpcap-dev - uses: ./.github/actions/bls name: Install BLS library - if: "env.GIT_DIFF != ''" + if: env.GIT_DIFF + - name: Install dependencies + if: env.GIT_DIFF run: sudo apt-get update && sudo apt-get install -y libpcap-dev + - name: Run Go Tests + if: env.GIT_DIFF env: CGO_LDFLAGS: "-L/usr/local/lib -ldashbls -lrelic_s -lmimalloc-secure -lgmp" CGO_CXXFLAGS: "-I/usr/local/include" run: | make test-group-${{ matrix.part }} NUM_SPLIT=6 - if: env.GIT_DIFF From 9bb0ff42715d2c792e98f901b51b2b95591ef862 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:06:59 +0100 Subject: [PATCH 06/11] chore: setup go later --- .github/workflows/tests.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a4f75472..40f7c95e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,10 +14,8 @@ jobs: matrix: part: ["00", "01", "02", "03", "04", "05"] steps: - - uses: actions/setup-go@v5.1.0 - with: - go-version: "1.23.2" - uses: actions/checkout@v4 + - uses: technote-space/get-diff-action@v6 with: PATTERNS: | @@ -28,9 +26,15 @@ jobs: go.sum Makefile + - uses: actions/setup-go@v5.1.0 + if: env.GIT_DIFF + with: + go-version: "1.23.2" + - name: Install libpcap if: env.GIT_DIFF run: sudo apt-get install --yes libpcap-dev + - uses: ./.github/actions/bls name: Install BLS library if: env.GIT_DIFF From 9b4febd9e03019759a1956028dbcbd915426a5e5 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:10:20 +0100 Subject: [PATCH 07/11] chore: trigger ci --- proto/tendermint/abci/types.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 0e64cdf6a..3453c1ce4 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -14,6 +14,7 @@ import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; // NOTE: When using custom types, mind the warnings. +// // https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues // //---------------------------------------- From 346552864c07e562670a361ac4df8399eef36375 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:13:31 +0100 Subject: [PATCH 08/11] chore: trigger tests --- test/e2e/node/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/node/main.go b/test/e2e/node/main.go index fc246e128..830008e1a 100644 --- a/test/e2e/node/main.go +++ b/test/e2e/node/main.go @@ -105,7 +105,7 @@ func run(ctx context.Context, configFile string) error { } func startAppServer(ctx context.Context, cfg *Config, logger log.Logger) error { - // Start remote signer (must start before node if running builtin). + // Start remote signer (must start before node if running builtin) if cfg.PrivValServer != "" { err := startRemoteSigner(ctx, cfg, logger) if err != nil { From 5d15d64c375f4faa6b4625e18828d52f755537aa Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:16:16 +0100 Subject: [PATCH 09/11] chore: remove fetch-depth to ensure CI will run correctly --- .github/workflows/check-generated.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 92ee8132d..4f2cf448f 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -23,8 +23,6 @@ jobs: go-version: "1.23.2" - uses: actions/checkout@v4 - with: - fetch-depth: 1 # we need a .git directory to run git diff - uses: technote-space/get-diff-action@v6 with: @@ -57,8 +55,6 @@ jobs: go-version: "1.23.2" - uses: actions/checkout@v4 - with: - fetch-depth: 1 # we need a .git directory to run git diff - uses: technote-space/get-diff-action@v6 with: From f18a8c51b79fe729a95cbe318a4746fda870bbac Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:47:42 +0100 Subject: [PATCH 10/11] chore: remove duplicate code --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40f7c95e6..115c8dde9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,16 +33,12 @@ jobs: - name: Install libpcap if: env.GIT_DIFF - run: sudo apt-get install --yes libpcap-dev + run: sudo apt-get update && sudo apt-get install --yes libpcap-dev - uses: ./.github/actions/bls name: Install BLS library if: env.GIT_DIFF - - name: Install dependencies - if: env.GIT_DIFF - run: sudo apt-get update && sudo apt-get install -y libpcap-dev - - name: Run Go Tests if: env.GIT_DIFF env: From 9b4750698998c20227e5a4157ebc2bfcd1e87535 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:59:46 +0100 Subject: [PATCH 11/11] check generated mocks when something (incl mockery version) changes in check-generated.yml --- .github/workflows/check-generated.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 4f2cf448f..c54e20c94 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -28,6 +28,8 @@ jobs: with: PATTERNS: | **/*.go + FILES: | + .github/workflows/check-generated.yml - name: "Check generated mocks" if: env.GIT_DIFF