Skip to content
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
90 changes: 73 additions & 17 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:

- name: Install dependencies needed for HIDAPI and Pillow
run: |
sudo apt-get update
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev

- name: Install dependencies
Expand Down Expand Up @@ -127,6 +128,76 @@ jobs:
name: Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.14" ]
env:
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
steps:
- uses: actions/checkout@v4

- name: Download contracts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/

- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: 'pip'

# ====================== SETUP PYTHON ====================== #

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install dependencies
run: |
poetry install

# ====================== SETUP DEVNET ====================== #

- name: Install devnet
run: ./starknet_py/tests/install_devnet.sh

# ====================== RUN TESTS ====================== #

- name: Check circular imports
run: |
poetry run poe circular_imports_check

- uses: asdf-vm/actions/setup@v3

- name: Run tests
run: |
poetry run poe test_ci_v2
poetry run poe test_ci_v1

- name: Generate coverage in XML
run: |
poetry run coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5

# ---------------------------------------------------------- #
# .....................RUN-LEDGER-TESTS..................... #
# ---------------------------------------------------------- #

run-ledger-tests:
name: Ledger Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -164,6 +235,7 @@ jobs:

- name: Install dependencies needed for HIDAPI and Pillow
run: |
sudo apt-get update
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev

- name: Install dependencies
Expand All @@ -180,7 +252,6 @@ jobs:
- name: Pull speculos image
run: docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools@sha256:${{ env.LEDGER_APP_DEV_TOOLS_SHA }}


- name: Clone LedgerHQ Starknet app repository
run: git clone https://github.com/LedgerHQ/app-starknet.git

Expand Down Expand Up @@ -224,16 +295,9 @@ jobs:

# ====================== RUN TESTS ====================== #

- name: Check circular imports
run: |
poetry run poe circular_imports_check

- uses: asdf-vm/actions/setup@v3

- name: Run tests
run: |
poetry run poe test_ci_v2
poetry run poe test_ci_v1
poetry run poe test_ci_ledger

- name: Generate coverage in XML
run: |
Expand Down Expand Up @@ -286,14 +350,6 @@ jobs:
python-version: "3.14"
cache: 'poetry'

- name: Install dependencies needed for HIDAPI and Pillow
run: |
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev

- name: Install dependencies
run: |
poetry install -E ledger

# ====================== SETUP DEVNET ====================== #

- name: Install devnet
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ test = [
]

test_ci = ["test_ci_v1", "test_ci_v2"]
test_ci_v1 = "coverage run -a -m pytest -n auto --contract_dir=v1 starknet_py --ignore=starknet_py/tests/e2e/docs --ignore=starknet_py/tests/e2e/tests_on_networks"
test_ci_v2 = "coverage run -a -m pytest -n auto --contract_dir=v2 starknet_py --ignore=starknet_py/tests/e2e/docs --ignore=starknet_py/tests/e2e/tests_on_networks"
test_ci_v1 = "coverage run -a -m pytest -n auto --contract_dir=v1 starknet_py --ignore=starknet_py/tests/e2e/docs --ignore=starknet_py/tests/e2e/tests_on_networks --ignore=starknet_py/tests/unit/signer/test_ledger_signer.py"
test_ci_v2 = "coverage run -a -m pytest -n auto --contract_dir=v2 starknet_py --ignore=starknet_py/tests/e2e/docs --ignore=starknet_py/tests/e2e/tests_on_networks --ignore=starknet_py/tests/unit/signer/test_ledger_signer.py"
test_ci_ledger = "coverage run -a -m pytest --contract_dir=v2 starknet_py/tests/unit/signer/test_ledger_signer.py"

test_ci_on_networks = "coverage run -a -m pytest --contract_dir=v2 starknet_py/tests/e2e/tests_on_networks --ignore=starknet_py/tests/e2e/tests_on_networks/account_test.py"
test_ci_on_networks_extended = "coverage run -a -m pytest --contract_dir=v2 starknet_py/tests/e2e/tests_on_networks"
Expand Down
Loading