From 7526cbd8f62c64068b6ee20180d9a37508e3a713 Mon Sep 17 00:00:00 2001 From: Chih Cheng Liang Date: Tue, 12 Sep 2023 23:50:14 +0800 Subject: [PATCH] [MPTWG] Update CI for MPTWG (#1591) ### Description Enable the MPT witness generator CI check ### Issue Link ### Type of change Bug fix (non-breaking change which fixes an issue) ### Contents - Run Go build and Go format on MPTWG - Ignore main tests CI run if no change on zkevm-circuits - Ignore MPTWG CI run if no change on MPTWG ### Rationale We want to enable automatic checks on MPTWG --- .github/workflows/lints.yml | 2 +- .github/workflows/mpt-witness-generator.yml | 49 +++++++++++++++++++ .../.github/workflows/go.yml | 33 ------------- 3 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/mpt-witness-generator.yml delete mode 100644 mpt-witness-generator/.github/workflows/go.yml diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 987e74d8ce..78d8c137aa 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -20,7 +20,7 @@ jobs: with: cancel_others: 'true' concurrent_skipping: 'same_content_newer' - paths_ignore: '["**/README.md"]' + paths_ignore: '["**/README.md", "mpt-witness-generator/**"]' lints: needs: [skip_check] diff --git a/.github/workflows/mpt-witness-generator.yml b/.github/workflows/mpt-witness-generator.yml new file mode 100644 index 0000000000..77da2fa9c8 --- /dev/null +++ b/.github/workflows/mpt-witness-generator.yml @@ -0,0 +1,49 @@ +name: MPT Witness Generator Checks + +on: + merge_group: + pull_request: + types: [synchronize, opened, reopened, ready_for_review] + push: + branches: + - main + +jobs: + skip_check: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + cancel_others: 'true' + concurrent_skipping: 'same_content_newer' + paths: '["mpt-witness-generator/**"]' + + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Format + uses: Jerome1337/gofmt-action@v1.0.5 + with: + gofmt-path: './mpt-witness-generator' + gofmt-flags: '-l -d' + + - name: Build + working-directory: ./mpt-witness-generator + run: go build -v ./... + + - name: Test + working-directory: ./mpt-witness-generator + env: + NO_GETH: true + run: go test -v ./... diff --git a/mpt-witness-generator/.github/workflows/go.yml b/mpt-witness-generator/.github/workflows/go.yml deleted file mode 100644 index 35860814a3..0000000000 --- a/mpt-witness-generator/.github/workflows/go.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Format - run: go fmt ./... - - - name: Build - run: go build -v ./... - - - name: Test - env: - NO_GETH: true - run: go test -v ./...