Skip to content

Add script

Add script #9

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: test ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup asdf
uses: asdf-vm/actions/setup@v3
- name: Fetch latest Scarb version from GitHub releases
id: scarb_version
shell: pwsh
run: |
$location = (Invoke-WebRequest -Uri "https://github.com/software-mansion/scarb/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/v','')
echo "Latest Scarb version found is $latest_version"
echo "LATEST=$latest_version" >> $env:GITHUB_OUTPUT
- name: Fetch latest Starknet Foundry version from GitHub releases
id: snfoundry_version
shell: pwsh
run: |
$location = (Invoke-WebRequest -Uri "https://github.com/foundry-rs/starknet-foundry/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/v','')
echo "Latest Starknet Foundry version found is $latest_version"
echo "LATEST=$latest_version" >> $env:GITHUB_OUTPUT
- name: Fetch latest Universal Sierra Compiler version from GitHub releases
id: usc_version
shell: pwsh
run: |
$location = (Invoke-WebRequest -Uri "https://github.com/software-mansion/universal-sierra-compiler/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/v','')
echo "Latest Universal Sierra Compiler version found is $latest_version"
echo "LATEST=$latest_version" >> $env:GITHUB_OUTPUT
- name: Run starknetup
run: ./starknetup.sh
- name: Check Scarb latest
run: scarb --version | grep "scarb ${{ steps.scarb_version.outputs.LATEST }}"
- name: Check Starknet Foundry latest
run: |
snforge --version | grep "snforge ${{ steps.snfoundry_version.outputs.LATEST }}"
sncast --version | grep "sncast ${{ steps.snfoundry_version.outputs.LATEST }}"
- name: Check Universal Sierra Compiler latest
run: universal-sierra-compiler --version | grep "universal-sierra-compiler ${LATEST}"
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck starknetup.sh
shfmt:
runs-on: ubuntu-latest
steps:
- uses: mfinelli/setup-shfmt@v3
- uses: actions/checkout@v4
- run: shfmt --diff starknetup.sh