Merge pull request #11 from push-protocol/feat/deploy-scripts #53
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: Lint and Build | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- 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 | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- 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 | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- 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: Extract foundry version | |
run: | | |
FOUNDRY_VERSION=$(grep 'snforge_std = ' Scarb.toml | sed 's/snforge_std = .\+ tag = "v\(.*\)".*/\1/') | |
echo "FOUNDRY_VERSION=$FOUNDRY_VERSION" >> "$GITHUB_ENV" | |
- uses: foundry-rs/setup-snfoundry@v3 | |
with: | |
starknet-foundry-version: ${{ env.FOUNDRY_VERSION }} | |
- name: Cairo Test | |
run: scarb test |