Skip to content

Migrate to devnet-rs and sncast #173

Migrate to devnet-rs and sncast

Migrate to devnet-rs and sncast #173

Workflow file for this run

name: Checks
on:
pull_request:
branches: "*"
jobs:
test_and_lint:
runs-on: macos-12
env:
DEVNET_BUILD_PATH: ${{ github.workspace }}/starknet-devnet-rs/target/release
steps:
- uses: actions/checkout@v3
# - 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 7586b55d221e9010809a6e61b7e28e53fc9ff5c2
popd
- name: Cache devnet build
uses: actions/cache@v3
with:
path: starknet-devnet-rs/target/release
key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ hashFiles('starknet-devnet-rs/Cargo.lock') }}
- 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
chmod +x ${{ github.workspace }}/starknet-devnet-rs/target/release/*
if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then
echo "Failed to build starknet-devnet-rs"
exit 1
fi
popd
else
echo "Found existing starknet-devnet-rs build, skipping compilation."
fi
- name: Setup scarb 0.6.0
uses: software-mansion/[email protected]
with:
scarb-version: "0.6.0"
- name: Install sncast 0.4.1
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh -s -- -v 0.4.1
source /Users/runner/.bashrc
echo "$(dirname $(which sncast))"
echo "$(dirname $(which sncast))" >> $GITHUB_PATH
- 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)"
echo "$DEVNET_PATH"
echo "$SCARB_PATH"
echo "$SNCAST_PATH"
$DEVNET_PATH --version
$SCARB_PATH --version
$SNCAST_PATH --version
swift test --disable-sandbox