From cf9a4d3d29c92998f6719b832da6ee609a085de6 Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 2 Jul 2024 19:43:05 -0300 Subject: [PATCH] ci: setup bulloak in CI --- .github/workflows/tests.yml | 12 ++++++++++-- package.json | 1 + test/unit/Greeter.tree | 8 ++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18624462..f2c756bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -127,7 +127,7 @@ jobs: run: yarn test:integration lint: - name: Lint Commit Messages + name: Static Analysis runs-on: ubuntu-latest steps: @@ -148,7 +148,15 @@ jobs: node-version: 20.x cache: 'yarn' + - name: Install bulloak + uses: baptiste0928/cargo-install@v3 + with: + crate: bulloak + - name: Install dependencies run: yarn --frozen-lockfile --network-concurrency 1 - - run: yarn lint:check \ No newline at end of file + - run: yarn lint:check + + - name: Run bulloak check + run: yarn lint:bulloak diff --git a/package.json b/package.json index 0c743777..cdebf3ec 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", "lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix", "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js", + "lint:bulloak": "find test/unit -name '*.tree' | xargs bulloak check", "lint:sol-logic": "solhint -c .solhint.json 'src/**/*.sol' 'script/**/*.sol'", "lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'", "prepare": "husky install", diff --git a/test/unit/Greeter.tree b/test/unit/Greeter.tree index bbc74ea5..67bda499 100644 --- a/test/unit/Greeter.tree +++ b/test/unit/Greeter.tree @@ -1,4 +1,4 @@ -Greeter::constructor +UnitGreeter::constructor ├── when passing valid greeting string │ ├── it deploys │ ├── it sets the greeting string @@ -8,13 +8,13 @@ Greeter::constructor └── it reverts -Greeter::greet +UnitGreeter::greet └── when called ├── it returns the greeting string └── it returns the token balance of the contract -Greeter::setGreeting +UnitGreeter::setGreeting ├── when called by the owner │ ├── when passing a valid greeting string │ │ ├── it sets the greeting string @@ -22,4 +22,4 @@ Greeter::setGreeting │ └── when passing an empty greeting string │ └── it reverts └── when called by a non-owner - └── it reverts \ No newline at end of file + └── it reverts