-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
233d93d
commit a31400e
Showing
1 changed file
with
30 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
name: CI | ||
name: Lint and test | ||
|
||
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: Test | ||
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 | ||
- 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 test | ||
run: scarb test |