Skip to content

Add KeyPair.from_keystore method (#1371) #4802

Add KeyPair.from_keystore method (#1371)

Add KeyPair.from_keystore method (#1371) #4802

Workflow file for this run

name: Checks
env:
CAIRO_LANG_VERSION: "0.13.1"
DEVNET_VERSION: "0.0.5"
on:
push:
branches:
- master
- development
pull_request:
workflow_dispatch:
jobs:
# ---------------------------------------------------------- #
# ...................LINT-FORMAT-TYPECHECK.................. #
# ---------------------------------------------------------- #
lint-format-typecheck:
name: Lint - Format - Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Check poetry.lock
run: |
poetry lock --check
- name: Lint
run: |
poetry run poe lint
- name: Format
run: |
poetry run poe format_check
- name: Typecheck
run: |
poetry run poe typecheck
# ---------------------------------------------------------- #
# .......................SETUP-TESTS........................ #
# ---------------------------------------------------------- #
setup-tests:
name: Setup Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.12" ]
steps:
# ====================== SETUP ====================== #
- uses: actions/checkout@v4
- uses: asdf-vm/actions/setup@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== CONTRACTS v2 ====================== #
- name: Cache contracts v2
id: cache-contracts_v2
uses: actions/cache@v3
with:
path: starknet_py/tests/e2e/mock/contracts_v2/target
key: ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts_v2') }}
- name: Compile contracts v2
if: steps.cache-contracts_v2.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts v2
# ====================== CONTRACTS v1 ====================== #
- name: Cache contracts v1
id: cache-contracts_v1
uses: actions/cache@v3
with:
path: starknet_py/tests/e2e/mock/contracts_v1/target
key: ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts_v1') }}
- name: Compile contracts v1
if: steps.cache-contracts_v1.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts v1
# ====================== CONTRACTS v0 ====================== #
- name: Cache contracts v0
id: cache-contracts
uses: actions/cache@v3
with:
path: starknet_py/tests/e2e/mock/contracts_compiled
key: ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts', 'poetry.lock') }}-${{ env.CAIRO_LANG_VERSION }}
- name: Install deprecated cairo compiler
if: steps.cache-contracts.outputs.cache-hit != 'true'
run: |
pip install --upgrade setuptools
pip install cairo-lang==${{ env.CAIRO_LANG_VERSION }}
- name: Compile contracts v0
if: steps.cache-contracts.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts v0
- name: Upload contracts v0
uses: actions/upload-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
# ---------------------------------------------------------- #
# ........................RUN-TESTS......................... #
# ---------------------------------------------------------- #
run-tests:
name: Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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
- 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@v3
# ---------------------------------------------------------- #
# ..................RUN-TESTS-ON-NETWORKS................... #
# ---------------------------------------------------------- #
run-tests-on-networks:
name: Tests on networks (testnet and integration)
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
SEPOLIA_INTEGRATION_RPC_URL: ${{ secrets.SEPOLIA_INTEGRATION_RPC_URL }}
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
SEPOLIA_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_ACCOUNT_ADDRESS }}
SEPOLIA_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_ACCOUNT_PRIVATE_KEY }}
SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY }}
SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS }}
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- name: Run tests
run: |
poetry run poe test_ci_on_networks
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
# ---------------------------------------------------------- #
# ....................RUN-TESTS-WINDOWS..................... #
# ---------------------------------------------------------- #
run-tests-windows:
if: ${{ github.event_name != 'pull_request' }}
name: Tests Windows
needs: setup-tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
with:
toolchain: stable
- name: Download contracts
uses: actions/download-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: |
$DEVNET_INSTALL_DIR = "$(git rev-parse --show-toplevel)/starknet_py/tests/e2e/devnet"
cargo install starknet-devnet --version ${{ env.DEVNET_VERSION }} --root $DEVNET_INSTALL_DIR
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- 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@v3
# ---------------------------------------------------------- #
# .....................RUN-DOCS-TESTS....................... #
# ---------------------------------------------------------- #
run-docs-tests:
name: Docs Tests
needs: setup-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Download contracts
uses: actions/download-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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: Run tests
run: |
poetry run poe test_ci_docs_v2
poetry run poe test_ci_docs_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
# ---------------------------------------------------------- #
# .................RUN-DOCS-TESTS-WINDOWS................... #
# ---------------------------------------------------------- #
run-docs-tests-windows:
if: ${{ github.event_name != 'pull_request' }}
name: Docs Tests Windows
needs: setup-tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
with:
toolchain: stable
- name: Download contracts
uses: actions/download-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
# ====================== SETUP DEVNET ====================== #
- name: Install devnet
run: |
$DEVNET_INSTALL_DIR = "$(git rev-parse --show-toplevel)/starknet_py/tests/e2e/devnet"
cargo install starknet-devnet --version ${{ env.DEVNET_VERSION }} --root $DEVNET_INSTALL_DIR
# ====================== RUN TESTS ====================== #
- name: Run tests
run: |
poetry run poe test_ci_docs_v2
poetry run poe test_ci_docs_v1
- name: Generate coverage in XML
run: |
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3