Skip to content

Support specifying version set to use for installation (latest, compatible) #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 72 additions & 61 deletions .github/workflows/_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ on:

env:
GITHUB_TOKEN: ${{ github.token }}
SCARB_COMPATIBLE_VERSION: 2.10.1
FOUNDRY_COMPATIBLE_VERSION: 0.39.0
COVERAGE_COMPATIBLE_VERSION: 0.5.0
PROFILER_COMPATIBLE_VERSION: 0.8.1

jobs:
test-legacy-asdf:
name: test ${{ inputs.os }} (legacy asdf)
env:
ASDF_VERSION: v0.15.0
runs-on: ${{ inputs.os }}
fetch-latest-versions:
name: Fetch latest versions
runs-on: ubuntu-latest
outputs:
scarb_latest: ${{ steps.scarb_version.outputs.LATEST }}
snfoundry_latest: ${{ steps.snfoundry_version.outputs.LATEST }}
usc_latest: ${{ steps.usc_version.outputs.LATEST }}
coverage_latest: ${{ steps.coverage_version.outputs.LATEST }}
profiler_latest: ${{ steps.profiler_version.outputs.LATEST }}
steps:
- uses: actions/checkout@v4

- name: Setup legacy asdf
uses: asdf-vm/actions/setup@v3
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Fetch latest Scarb version from GitHub releases
id: scarb_version
run: |
Expand Down Expand Up @@ -59,93 +60,103 @@ jobs:
echo "Latest Cairo Profiler version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT

test-legacy-asdf:
name: test ${{ inputs.os }} (legacy asdf)
needs: fetch-latest-versions
env:
ASDF_VERSION: v0.15.0
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4

- name: Setup legacy asdf
uses: asdf-vm/actions/setup@v3
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Run starkup
run: ./starkup.sh

- name: Check Scarb latest
run: scarb --version | grep -x "scarb ${{ steps.scarb_version.outputs.LATEST }} (.*)"
- name: Check Scarb compatible
run: scarb --version | grep -x "scarb ${{ env.SCARB_COMPATIBLE_VERSION }} (.*)"

- name: Check Starknet Foundry latest
- name: Check Starknet Foundry compatible
run: |
snforge --version | grep -x "snforge ${{ steps.snfoundry_version.outputs.LATEST }}"
sncast --version | grep -x "sncast ${{ steps.snfoundry_version.outputs.LATEST }}"
snforge --version | grep -x "snforge ${{ env.FOUNDRY_COMPATIBLE_VERSION }}"
sncast --version | grep -x "sncast ${{ env.FOUNDRY_COMPATIBLE_VERSION }}"

- name: Check Universal Sierra Compiler latest
run: universal-sierra-compiler --version | grep -x "universal-sierra-compiler ${{ steps.usc_version.outputs.LATEST }}"
run: universal-sierra-compiler --version | grep -x "universal-sierra-compiler ${{ needs.fetch-latest-versions.outputs.usc_latest }}"

- name: Check Cairo Coverage latest
run: cairo-coverage --version | grep -x "cairo-coverage ${{ steps.coverage_version.outputs.LATEST }}"
- name: Check Cairo Coverage compatible
run: cairo-coverage --version | grep -x "cairo-coverage ${{ env.COVERAGE_COMPATIBLE_VERSION }}"

- name: Check Cairo Profiler latest
run: cairo-profiler --version | grep -x "cairo-profiler ${{ steps.profiler_version.outputs.LATEST }}"
- name: Check Cairo Profiler compatible
run: cairo-profiler --version | grep -x "cairo-profiler ${{ env.PROFILER_COMPATIBLE_VERSION }}"

test:
name: test ${{ inputs.os }}
env:
ASDF_VERSION: v0.16.2
name: test ${{ inputs.os }} (compatible versions)
needs: fetch-latest-versions
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4

- name: Fetch latest Scarb version from GitHub releases
id: scarb_version
- name: Run starkup
shell: bash
env:
SHELL: /bin/bash
run: |
latest_version=$(curl -sS --fail -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/software-mansion/scarb/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",')
echo "Latest Scarb version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT
./starkup.sh -y
echo "${ASDF_DATA_DIR:-$HOME/.asdf}/shims" >> $GITHUB_PATH

- name: Fetch latest Starknet Foundry version from GitHub releases
id: snfoundry_version
run: |
latest_version=$(curl -sS --fail -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/foundry-rs/starknet-foundry/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",')
echo "Latest Starknet Foundry version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT
- name: Check Scarb compatible
run: scarb --version | grep -x "scarb ${{ env.SCARB_COMPATIBLE_VERSION }} (.*)"

- name: Fetch latest Universal Sierra Compiler version from GitHub releases
id: usc_version
- name: Check Starknet Foundry compatible
run: |
latest_version=$(curl -sS --fail -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/software-mansion/universal-sierra-compiler/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",')
echo "Latest Universal Sierra Compiler version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT
snforge --version | grep -x "snforge ${{ env.FOUNDRY_COMPATIBLE_VERSION }}"
sncast --version | grep -x "sncast ${{ env.FOUNDRY_COMPATIBLE_VERSION }}"

- name: Fetch latest Cairo Coverage version from GitHub releases
id: coverage_version
run: |
latest_version=$(curl -sS --fail -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/software-mansion/cairo-coverage/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",')
echo "Latest Cairo Coverage version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT
- name: Check Universal Sierra Compiler latest
run: universal-sierra-compiler --version | grep -x "universal-sierra-compiler ${{ needs.fetch-latest-versions.outputs.usc_latest }}"

- name: Fetch latest Cairo Profiler version from GitHub releases
id: profiler_version
run: |
latest_version=$(curl -sS --fail -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/software-mansion/cairo-profiler/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",')
echo "Latest Cairo Profiler version found is $latest_version"
echo "LATEST=$latest_version" >> $GITHUB_OUTPUT
- name: Check Cairo Coverage compatible
run: cairo-coverage --version | grep -x "cairo-coverage ${{ env.COVERAGE_COMPATIBLE_VERSION }}"

- name: Run starkup
- name: Check Cairo Profiler compatible
run: cairo-profiler --version | grep -x "cairo-profiler ${{ env.PROFILER_COMPATIBLE_VERSION }}"

test-latest:
name: test ${{ inputs.os }} (latest versions)
needs: fetch-latest-versions
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4

- name: Run starkup with latest version set
shell: bash
env:
SHELL: /bin/bash
run: |
./starkup.sh -y
./starkup.sh -y --version-set latest
echo "${ASDF_DATA_DIR:-$HOME/.asdf}/shims" >> $GITHUB_PATH

- name: Check Scarb latest
run: scarb --version | grep -x "scarb ${{ steps.scarb_version.outputs.LATEST }} (.*)"
run: scarb --version | grep -x "scarb ${{ needs.fetch-latest-versions.outputs.scarb_latest }} (.*)"

- name: Check Starknet Foundry latest
run: |
snforge --version | grep -x "snforge ${{ steps.snfoundry_version.outputs.LATEST }}"
sncast --version | grep -x "sncast ${{ steps.snfoundry_version.outputs.LATEST }}"
snforge --version | grep -x "snforge ${{ needs.fetch-latest-versions.outputs.snfoundry_latest }}"
sncast --version | grep -x "sncast ${{ needs.fetch-latest-versions.outputs.snfoundry_latest }}"

- name: Check Universal Sierra Compiler latest
run: universal-sierra-compiler --version | grep -x "universal-sierra-compiler ${{ steps.usc_version.outputs.LATEST }}"
run: universal-sierra-compiler --version | grep -x "universal-sierra-compiler ${{ needs.fetch-latest-versions.outputs.usc_latest }}"

- name: Check Cairo Coverage latest
run: cairo-coverage --version | grep -x "cairo-coverage ${{ steps.coverage_version.outputs.LATEST }}"
run: cairo-coverage --version | grep -x "cairo-coverage ${{ needs.fetch-latest-versions.outputs.coverage_latest }}"

- name: Check Cairo Profiler latest
run: cairo-profiler --version | grep -x "cairo-profiler ${{ steps.profiler_version.outputs.LATEST }}"
run: cairo-profiler --version | grep -x "cairo-profiler ${{ needs.fetch-latest-versions.outputs.profiler_latest }}"

test-asdf-update:
name: test ${{ inputs.os }} (update asdf)
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ Starkup supports the installation of the following tools:
- [Cairo Coverage] utility for coverage reports generation for code written in Cairo programming language
- [CairoLS] vscode extension

## Installing specific versions

Starkup allows you to choose which versions of tools to install using the `--version-set` flag.
The following version sets are available:

- `compatible` (default): Installs versions of all tools that are known to be compatible with each other
- `latest`: Installs latest versions of all tools, which **may be incompatible** with each other

To install a specific version set (e.g. `latest`), run the following:

```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh -s -- --version-set latest
```

## Architecture

Starkup relies on [ASDF] package manager to install the latest versions of [Scarb] and [Starknet Foundry]. If you don't have [ASDF] yet, no worries - Starkup can handle that as well!
Expand Down
Loading