Support RPC 0.8.0 #538
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: Checks | |
on: | |
pull_request: | |
jobs: | |
test_and_lint: | |
runs-on: macos-14 | |
env: | |
DEVNET_SHA: 47ee2a73c227ee356f344ce94e5f61871299be80 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Xcode 15.3 | |
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
with: | |
xcode-version: 15.3 | |
- name: Cache/Restore Mint packages | |
id: mint-cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ github.workspace }}/mint | |
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} | |
restore-keys: ${{ runner.os }}-mint- | |
- name: Check if Mint is installed | |
id: mint-installed | |
run: brew list | grep mint | |
continue-on-error: true | |
- name: Upgrade package manager "Mint" | |
if: steps.mint-installed.outcome == 'success' | |
run: | | |
brew upgrade mint | |
- name: Install package manager "Mint" | |
if: steps.mint-installed.outcome != 'success' | |
run: | | |
brew install mint | |
- name: Install command line tool (if not yet cached) | |
if: steps.mint-cache.outputs.cache-hit != 'true' | |
run: mint bootstrap | |
- name: Run SwiftFormat lint | |
run: mint run swiftformat --lint . | |
# TODO: Replace with installing release when release is available | |
- name: Clone starknet-devnet-rs | |
run: | | |
git clone https://github.com/0xSpaceShard/starknet-devnet-rs.git starknet-devnet-rs | |
pushd ${{ github.workspace }}/starknet-devnet-rs | |
git checkout ${{ env.DEVNET_SHA }} | |
popd | |
- name: Cache devnet build | |
uses: actions/cache@v3 | |
with: | |
path: starknet-devnet-rs/target/release | |
key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ env.DEVNET_SHA }} | |
- name: Build devnet | |
run: | | |
if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
pushd ${{ github.workspace }}/starknet-devnet-rs | |
cargo build --release | |
popd | |
else | |
echo "Found existing starknet-devnet-rs build, skipping compilation." | |
fi | |
- name: Setup scarb 0.7.0 | |
uses: software-mansion/[email protected] | |
with: | |
scarb-version: "0.7.0" | |
- name: Setup asdf | |
uses: asdf-vm/actions/setup@v2 | |
- name: Install sncast 0.6.0 | |
run: | | |
asdf plugin add starknet-foundry | |
asdf install starknet-foundry 0.6.0 | |
asdf global starknet-foundry 0.6.0 | |
- name: Check Cairo contracts formatting | |
working-directory: ./Tests/StarknetTests/Resources/Contracts/src | |
run: scarb fmt --check | |
- name: Run tests | |
run: | | |
export DEVNET_PATH=${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet | |
export SCARB_PATH="$(which scarb)" | |
export SNCAST_PATH="$(which sncast)" | |
swift test --disable-sandbox |