feat: add cairo-lint ci #581
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: read-all | |
jobs: | |
markdown: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
sudo gem install mdl | |
mdl -s .github/linter/readme_style.rb README.md | |
mdl -s .github/linter/base_style.rb .github | |
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 | |
run: | | |
scarb cairo-lint > lint_output.txt | |
if grep -i "warning:" lint_output.txt; then | |
echo "Linting failed due to warnings" | |
exit 1 | |
fi | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: asdf-vm/actions/install@v3 | |
- run: scarb test |