From 1048c190a6dd446c97ce39278a5a78f0008bbcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 19 Mar 2026 13:28:08 -0700 Subject: [PATCH 1/3] add Cadence linter --- .github/workflows/cadence_tests.yml | 14 ++++++++------ Makefile | 11 +++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/cadence_tests.yml b/.github/workflows/cadence_tests.yml index ceec0582..e7149bcd 100644 --- a/.github/workflows/cadence_tests.yml +++ b/.github/workflows/cadence_tests.yml @@ -28,15 +28,17 @@ jobs: restore-keys: | ${{ runner.os }}-go- - name: Install Flow CLI - run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" - - name: Flow CLI Version - run: flow version - - name: Update PATH - run: echo "/root/.local/bin" >> $GITHUB_PATH + run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v2.15.3 + - name: Update PATH and show Flow version + run: | + echo "/root/.local/bin" >> $GITHUB_PATH + echo "$HOME/.local/bin" >> $GITHUB_PATH + which flow || true + flow version - name: Install dependencies run: flow deps install --skip-alias --skip-deployments - name: Run tests - run: flow test --cover --covercode="contracts" --coverprofile="coverage.lcov" ./cadence/tests/*_test.cdc + run: make ci - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8c3e86cd --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: test +test: + flow test --cover --covercode="contracts" --coverprofile="coverage.lcov" ./cadence/tests/*_test.cdc + +.PHONY: lint +lint: + find cadence -name "*.cdc" | xargs flow cadence lint \ + | tee /dev/stderr | tail -n2 | grep -q "Lint passed" + +.PHONY: ci +ci: lint test From df81a4ffd991f9cfeaf21e05370e3d8bffc7eda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 20 Mar 2026 09:10:57 -0700 Subject: [PATCH 2/3] treat warnings as errors Co-authored-by: patrick <72362902+holyfuchs@users.noreply.github.com> --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8c3e86cd..5f666cc7 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,7 @@ test: .PHONY: lint lint: - find cadence -name "*.cdc" | xargs flow cadence lint \ - | tee /dev/stderr | tail -n2 | grep -q "Lint passed" + find cadence -name "*.cdc" | xargs flow cadence lint --warnings-as-errors .PHONY: ci ci: lint test From 01778fc2498f9e7400ed6fa4ee5b9894ca5ec943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 10 Apr 2026 14:13:01 -0700 Subject: [PATCH 3/3] update to latest Flow CLI --- .github/workflows/cadence_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cadence_tests.yml b/.github/workflows/cadence_tests.yml index 656f12e6..3375d365 100644 --- a/.github/workflows/cadence_tests.yml +++ b/.github/workflows/cadence_tests.yml @@ -37,7 +37,7 @@ jobs: restore-keys: | ${{ runner.os }}-flow-emulator-fork- - name: Install Flow CLI - run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v2.15.3 + run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v2.16.0 - name: Update PATH and show Flow version run: | echo "/root/.local/bin" >> $GITHUB_PATH