Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kkawula authored Jan 17, 2025
2 parents 50759d0 + 8ce451e commit 49096fc
Show file tree
Hide file tree
Showing 73 changed files with 1,081 additions and 295 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.* text eol=lf
*.png -text
*.jpg -text
*.gif -text
32 changes: 19 additions & 13 deletions .github/ISSUE_TEMPLATE/work_item.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
name: Work item
description: Submit an actionable task
body:
- type: dropdown
id: tool-name
- type: textarea
id: current-state
attributes:
label: Which components does the task require to be changed? (think hard pls)
multiple: true
options:
- snforge
- sncast
- cairo-profiler
- other (describe below)
label: Current State
description: Describe the current state and outline the problem
placeholder: Currently, the `print_a` cheatcode prints `"a"` to stdout. This is problematic because user might want it to be printed on their actual printer.
validations:
required: true

- type: textarea
id: description
- type: input
id: objective
attributes:
label: Description
description: Describe the issue here.
label: Objective
description: Briefly describe the correct state
placeholder: The `print_a` cheatcode should magically detect if user wants to print to stdout or a printer.
validations:
required: true

- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Provide additional context on the desired state.
placeholder: If we can detect any printers in local network it might indicate that user wants to print to it.
validations:
required: false
68 changes: 52 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI

env:
DEVNET_REV: ef789b700770fa27a2fc057b3d1c610771be27d9

on:
pull_request:
merge_group:
Expand All @@ -11,68 +14,83 @@ on:
jobs:
test-forge-unit-and-integration:
name: Test Forge / Unit and Integration Tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
- uses: software-mansion/setup-scarb@v1
- uses: software-mansion/setup-universal-sierra-compiler@v1
- run: cargo test --release --lib -p forge
- run: cargo test --release --bin snforge
- run: cargo test --release integration -p forge

build-test-forge-e2e-nextest-archive:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Build and archive tests
run: cargo nextest archive --release -p forge --archive-file nextest-archive.tar.zst
run: cargo nextest archive --release -p forge --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst'
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst
name: nextest-archive-${{ matrix.os }}
path: nextest-archive-${{ matrix.os }}.tar.zst

test-forge-e2e:
name: Test Forge / E2E Tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
needs: build-test-forge-e2e-nextest-archive
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3, 4, 5, 6, 7, 8 ]
os: [ ubuntu-latest, windows-latest ]
steps:
- name: Extract branch name
if: github.event_name != 'pull_request'
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
shell: bash

- name: Extract branch name on pull request
if: github.event_name == 'pull_request'
run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
shell: bash

- name: Extract repo name and owner
if: github.event_name != 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV
shell: bash

- name: Extract repo name and owner on pull request
if: github.event_name == 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)" >> $GITHUB_ENV
shell: bash

- name: Print repo name
run: echo 'The repo name is' $REPO_NAME
shell: bash

- name: Get branch name
run: echo 'The branch name is' $BRANCH_NAME
shell: bash

- name: Install cairo-profiler
if: runner.os != 'Windows'
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh
- name: Install cairo-coverage
if: runner.os != 'Windows'
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
Expand All @@ -84,9 +102,9 @@ jobs:
- uses: taiki-e/install-action@nextest
- uses: actions/download-artifact@v4
with:
name: nextest-archive
name: nextest-archive-${{ matrix.os }}
- name: nextest partition ${{ matrix.partition }}/8
run: cargo nextest run --partition 'count:${{ matrix.partition }}/8' --archive-file 'nextest-archive.tar.zst' e2e
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/8' --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' e2e

test-scarb-2-8-3:
name: Test scarb 2.8.3
Expand Down Expand Up @@ -188,23 +206,38 @@ jobs:

test-cast:
name: Test Cast
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
with:
toolchain: stable
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
- name: Install starknet-devnet-rs
run: ./scripts/install_devnet.sh
- name: Install starknet-devnet-rs on Linux/Macos
if: runner.os != 'Windows'
run: |
./scripts/install_devnet.sh
- name: Cache devnet build
if: runner.os == 'Windows'
id: windows-devnet-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\crates\sncast\tests\utils\devnet
key: ${{ runner.os }}-devnet-${{ env.DEVNET_REV }}
- name: Install devnet
if: runner.os == 'Windows' && steps.windows-devnet-cache.outputs.cache-hit != 'true'
run: |
$DEVNET_INSTALL_DIR = "${{ github.workspace }}\crates\sncast\tests\utils\devnet"
cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked --rev ${{ env.DEVNET_REV }} --root $DEVNET_INSTALL_DIR
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.7.0"
- uses: software-mansion/setup-universal-sierra-compiler@v1
- name: Run tests
run: cargo test --release -p sncast
- name: Run test in debug profile
run: cargo test -p sncast test_happy_case_common_arguments_after_subcommand

test-conversions:
name: Test Conversions
Expand All @@ -229,7 +262,10 @@ jobs:

test-scarb-api:
name: Test Scarb Api
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
get-scarb-versions:
if: "! github.event.repository.fork"
name: Get Scarb versions
outputs:
versions: ${{ steps.get_versions.outputs.versions }}
Expand All @@ -30,6 +31,7 @@ jobs:
echo "versions=[${scarb_versions[@]}]" >> "$GITHUB_OUTPUT"
test-forge-unit-and-integration:
if: "! github.event.repository.fork"
runs-on: ubuntu-latest
needs: get-scarb-versions
strategy:
Expand All @@ -50,6 +52,7 @@ jobs:
- run: cargo test --release -p forge integration

test-forge-e2e:
if: "! github.event.repository.fork"
runs-on: ubuntu-latest
needs: get-scarb-versions
strategy:
Expand Down Expand Up @@ -89,6 +92,7 @@ jobs:
- run: cargo test --release -p forge e2e

test-cast:
if: "! github.event.repository.fork"
runs-on: ubuntu-latest
needs: get-scarb-versions
strategy:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Cheatcode for getting block hash.

## [0.36.0] - 2025-01-15

### Forge

#### Changed

- Trace files saved in `snfoundry_trace` directory will now use `_` as separators instead of `::`

### Cast

#### Added

- When using `--max-fee` with transactions v3, calculated max gas and max gas unit price are automatically validated to ensure they are greater than 0 after conversion
- interactive interface that allows setting created or imported account as the default

#### Changed

- Values passed to the `--max-fee`, `--max-gas`, and `--max-gas-unit-price` flags must be greater than 0

#### Deprecated

- `--version` flag

## [0.35.1] - 2024-12-16

Expand Down
36 changes: 17 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 49096fc

Please sign in to comment.