Skip to content

Add Cairo compilation tests #2

Add Cairo compilation tests

Add Cairo compilation tests #2

name: Compile Cairo contracts
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
generate_and_compile:
name: Compile Cairo contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Generate contracts
run: yarn workspace @openzeppelin/wizard-cairo update_scarb_project
- name: Extract scarb version
run: |
SCARB_VERSION=$(grep 'scarb-version = ' packages/core-cairo/test_project/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: Compile contracts
working-directory: ./packages/core-cairo/test_project
run: scarb build