From 010395e5f7967b445c5bab82aaf3c34a936a7ab0 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sun, 3 Nov 2024 02:02:29 +0700 Subject: [PATCH 1/5] finalize ci --- .github/workflows/check.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1c54c2b1..e1280b76 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -24,3 +24,23 @@ jobs: - uses: actions/checkout@v4 - uses: asdf-vm/actions/install@v3 - run: scarb test + + cairo-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Rust nightly + uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt, clippy + - name: Install cairo-lint + run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint + + - uses: asdf-vm/actions/install@v3 + - name: Run cairo-lint and check for warnings + run: | + scarb cairo-lint > lint_output.txt 2>&1 + if grep -qi "warning:" lint_output.txt; then + echo "Linting failed due to warnings" + exit 1 + fi \ No newline at end of file From 7b81a12117d0b2cea37f007d0530b73e6d6bc2c5 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sun, 3 Nov 2024 02:09:30 +0700 Subject: [PATCH 2/5] add cache --- .github/workflows/check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e1280b76..e5862bbb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -31,6 +31,9 @@ jobs: - uses: actions/checkout@v4 - name: Setup Rust nightly uses: dtolnay/rust-toolchain@nightly + - name: Cache Rust dependencies + uses: actions/cache@v3 + with: components: rustfmt, clippy - name: Install cairo-lint @@ -40,7 +43,7 @@ jobs: - name: Run cairo-lint and check for warnings run: | scarb cairo-lint > lint_output.txt 2>&1 - if grep -qi "warning:" lint_output.txt; then + if grep -qi "warning" lint_output.txt; then echo "Linting failed due to warnings" exit 1 fi \ No newline at end of file From ccb3fb0ec690f1e8c82338b78a5df5c12b573b23 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sun, 3 Nov 2024 02:10:11 +0700 Subject: [PATCH 3/5] add cache --- .github/workflows/check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e5862bbb..863e77ab 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -33,9 +33,6 @@ jobs: uses: dtolnay/rust-toolchain@nightly - name: Cache Rust dependencies uses: actions/cache@v3 - - with: - components: rustfmt, clippy - name: Install cairo-lint run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint From 2cfbf4dff88b8a9c53bcc1e28afc84a2d08d863b Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sun, 3 Nov 2024 02:12:17 +0700 Subject: [PATCH 4/5] add cache and pin cairo-lint commit --- .github/workflows/check.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 863e77ab..0e9b1d58 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,6 +8,10 @@ on: pull_request: permissions: read-all +env: + CAIRO_LINT_REF: e6dbb895 + + jobs: markdown: runs-on: ubuntu-latest @@ -34,8 +38,8 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 - name: Install cairo-lint - run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint - + run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint -rev ${{ env.CAIRO_LINT_REF }} + - uses: asdf-vm/actions/install@v3 - name: Run cairo-lint and check for warnings run: | From 8bdabb2898e872a80ddac72c3520a01e7d8f6681 Mon Sep 17 00:00:00 2001 From: Dao Nguyen Date: Sun, 3 Nov 2024 02:13:46 +0700 Subject: [PATCH 5/5] fix action --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0e9b1d58..a7c30fe4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -38,7 +38,7 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 - name: Install cairo-lint - run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint -rev ${{ env.CAIRO_LINT_REF }} + run: cargo install scarb-cairo-lint --git https://github.com/keep-starknet-strange/cairo-lint --rev ${{ env.CAIRO_LINT_REF }} - uses: asdf-vm/actions/install@v3 - name: Run cairo-lint and check for warnings