From 42ff7a9b9ba138b307dfd9cfd0641d856b007d71 Mon Sep 17 00:00:00 2001 From: eddnewgate Date: Sun, 28 Jul 2024 23:56:04 +0545 Subject: [PATCH] feat: lint fix --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++-------------- Scarb.toml | 1 + 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4755d78..616a4a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,27 +1,41 @@ -name: CI +name: Lint and Build on: - workflow_dispatch: + pull_request: + branches: + - main push: branches: - - main - pull_request: -permissions: read-all + - main jobs: - check: + lin: + name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: software-mansion/setup-scarb@v1 - - name: Check cairo format - run: scarb fmt --check - + - uses: actions/checkout@v3 + - name: Extract scarb version + run: | + SCARB_VERSION=$(grep 'scarb-version = ' Scarb.toml | sed 's/scarb-version = "\(.*\)"/\1/') + echo "SCARB_VERSION=$SCARB_VERSION" >> $GITHUB_ENV + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: ${{ env.SCARB_VERSION }} + - name: Cairo lint + run: scarb fmt --check + test: + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: software-mansion/setup-scarb@v1 - - uses: foundry-rs/setup-snfoundry@v3 - - name: Test cairo contract - run: scarb test \ No newline at end of file + - uses: actions/checkout@v3 + - name: Extract scarb version + run: | + SCARB_VERSION=$(grep 'scarb-version = ' Scarb.toml | sed 's/scarb-version = "\(.*\)"/\1/') + echo "SCARB_VERSION=$SCARB_VERSION" >> $GITHUB_ENV + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: ${{ env.SCARB_VERSION }} + - uses: foundry-rs/setup-snfoundry@v3 + - name: Cairo Build + run: scarb build \ No newline at end of file diff --git a/Scarb.toml b/Scarb.toml index ba224d1..12559b2 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -2,6 +2,7 @@ name = "push_comm" version = "0.1.0" edition = "2023_11" +scarb-version = "2.7.0-rc.4" # See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html