Skip to content

Remove GatewayClient #4053

Remove GatewayClient

Remove GatewayClient #4053

Workflow file for this run

name: Checks
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@v3
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'poetry'
- name: Install dependencies
run: |
poetry install --without py39-dev
- 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.9" ]
steps:
# ====================== SETUP ====================== #
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'pip'
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- 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 --without py39-dev
# ====================== CONTRACTS v0 ====================== #
- name: Cache contracts
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') }}
- name: Compile contracts
if: steps.cache-contracts.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts
- name: Upload contracts
uses: actions/upload-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
# ====================== CAIRO SETUP ====================== #
- name: Install rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Clone Cairo1 compiler repository
uses: actions/checkout@v3
with:
repository: starkware-libs/cairo
persist-credentials: false
ref: v2.0.0
path: cairo
- name: Cache rust dependencies
id: cache-rust
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build compiler
if: steps.cache-rust.outputs.cache-hit != 'true'
working-directory: ./cairo
run: |
cargo build
- name: Build starknet-compile
working-directory: ./cairo
run: |
cargo run --bin starknet-compile -- --version
cargo run --bin starknet-sierra-compile -- --version
- name: Create manifest file
run: |
readlink -f cairo/Cargo.toml >> starknet_py/tests/e2e/manifest-path
# ---------------------------------------------------------- #
# ........................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" ]
steps:
- uses: actions/checkout@v3
- 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.9"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- 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 --without py39-dev
# ====================== 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:
INTEGRATION_RPC_URL: ${{ secrets.INTEGRATION_RPC_URL }}
TESTNET_RPC_URL: ${{ secrets.TESTNET_RPC_URL }}
INTEGRATION_ACCOUNT_PRIVATE_KEY: ${{ secrets.INTEGRATION_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_ACCOUNT_ADDRESS: ${{ secrets.INTEGRATION_ACCOUNT_ADDRESS }}
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
TESTNET_ACCOUNT_ADDRESS: ${{ secrets.TESTNET_ACCOUNT_ADDRESS }}
steps:
- uses: actions/checkout@v3
- 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.9"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'poetry'
- name: Install dependencies
run: |
poetry install --without py39-dev
# ====================== RUN TESTS ====================== #
- name: Check circular imports
run: |
poetry run poe circular_imports_check
- name: Run tests
run: |
poetry run poe test_ci_on_networks_full_node
poetry run poe test_ci_on_networks_gateway
- 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" ]
steps:
- uses: actions/checkout@v3
- 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.9"
cache: 'pip'
# ====================== SETUP WSL ====================== #
- name: Setup WSL
uses: Vampire/setup-wsl@v2
- name: Setup WSL devnet
shell: wsl-bash {0}
run: |
sudo apt-get -y update
sudo apt install -y wget software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.9
apt-get install -y python3-pip
sudo apt install -y libgmp3-dev
sudo apt-get install -y git
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.6.2
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- 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 --without py39-dev
# ====================== 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" ]
steps:
- uses: actions/checkout@v3
- 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.9"
cache: 'pip'
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- 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 --without py39-dev
# ====================== 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" ]
steps:
- uses: actions/checkout@v3
- 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.9"
cache: 'pip'
# ====================== SETUP WSL ====================== #
- name: Setup WSL
uses: Vampire/setup-wsl@v2
- name: Setup WSL devnet
shell: wsl-bash {0}
run: |
sudo apt-get -y update
sudo apt install -y wget software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.9
apt-get install -y python3-pip
sudo apt install -y libgmp3-dev
sudo apt-get install -y git
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.6.2
# ====================== SETUP PYTHON ====================== #
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config installer.modern-installation false
- name: Install python 3.9 requirements
run: |
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
pip install -r requirements.txt
- 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 --without py39-dev
# ====================== 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