|
| 1 | +name: Test localnet-dependent tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main, feat/*] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
| 10 | + |
| 11 | +jobs: |
| 12 | + localnet: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, macos-latest] |
| 17 | + python-version: [3.11] |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v2 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + python3 -m pip install --upgrade pip |
| 34 | + pip3 install -r requirements.txt |
| 35 | + pip3 install -r ./requirements-dev.txt --upgrade |
| 36 | +
|
| 37 | + - name: Set up MultiversX localnet |
| 38 | + run: | |
| 39 | + mkdir -p ~/multiversx-sdk |
| 40 | + export PYTHONPATH=. |
| 41 | + python3 -m multiversx_sdk_cli.cli localnet prerequisites --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
| 42 | + python3 -m multiversx_sdk_cli.cli localnet build --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
| 43 | + |
| 44 | + # "Go" and artifacts from "GOPATH/pkg/mod" are not needed anymore. |
| 45 | + sudo rm -rf ~/multiversx-sdk/golang |
| 46 | + |
| 47 | + python3 -m multiversx_sdk_cli.cli localnet clean --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
| 48 | + python3 -m multiversx_sdk_cli.cli localnet config --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
| 49 | + nohup python3 -m multiversx_sdk_cli.cli localnet start --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml > localnet.log 2>&1 & echo $! > localnet.pid |
| 50 | + sleep 120 |
| 51 | +
|
| 52 | + - name: Test localnet dependent tests |
| 53 | + run: | |
| 54 | + pytest -m require_localnet . |
| 55 | + python3 -m multiversx_sdk_cli.cli localnet clean --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
0 commit comments