Skip to content

refactor: move from strata-state to strata-primitives #2024

refactor: move from strata-state to strata-primitives

refactor: move from strata-state to strata-primitives #2024

Workflow file for this run

name: Run functional tests
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint test files
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "^3.10" # Keep in sync with `pyproject.toml`
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: functional-tests/.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
working-directory: functional-tests
#if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' # this was giving issues in cache
run: poetry install --no-root --no-interaction
- name: Check formatting
working-directory: functional-tests
run: poetry run ruff format --check
- name: Lint
working-directory: functional-tests
run: poetry run ruff check
run:
name: Run functional tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cleanup Space
uses: ./.github/actions/cleanup
- name: Install bitcoind
env:
BITCOIND_VERSION: "28.0"
BITCOIND_ARCH: "x86_64-linux-gnu"
SHASUM: "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc"
run: |
curl -fsSLO --proto "=https" --tlsv1.2 "https://bitcoincore.org/bin/bitcoin-core-${{ env.BITCOIND_VERSION }}/bitcoin-${{ env.BITCOIND_VERSION }}-${{ env.BITCOIND_ARCH }}.tar.gz"
sha256sum -c <<< "$SHASUM bitcoin-${{ env.BITCOIND_VERSION }}-${{ env.BITCOIND_ARCH }}.tar.gz"
tar xzf "bitcoin-${{ env.BITCOIND_VERSION }}-${{ env.BITCOIND_ARCH }}.tar.gz"
sudo install -m 0755 -t /usr/local/bin bitcoin-${{ env.BITCOIND_VERSION }}/bin/*
bitcoind --version
rm -rf "bitcoin-${{ env.BITCOIND_VERSION }}" "bitcoin-${{ env.BITCOIND_VERSION }}-${{ env.BITCOIND_ARCH }}.tar.gz"
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "^3.10" # Keep in sync with `pyproject.toml`
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: functional-tests/.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
working-directory: functional-tests
#if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' # this was giving issues in cache
run: poetry install --no-root --no-interaction
- name: Set up Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-07-27
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Build Cargo project
run: cargo build --locked
- name: Run functional tests (1)
id: funcTestsRun1
continue-on-error: true
run: |
export PATH=$(realpath target/debug/):$PATH
which strata-client
cd functional-tests && \
poetry run python entry.py
# Run again just to be sure as some tests are flaky
- name: Run functional tests (2)
if: steps.funcTestsRun1.outcome == 'failure'
run: |
export PATH=$(realpath target/debug/):$PATH
which strata-client
cd functional-tests && \
poetry run python entry.py
functional-tests-success:
name: Check that all checks pass
runs-on: ubuntu-latest
if: always()
needs: [lint, run]
timeout-minutes: 60
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}