|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master] |
| 8 | + workflow_dispatch: # https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + # if a PR gets force pushed, cancel the current run and run the new one |
| 13 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 14 | + |
| 15 | +jobs: |
| 16 | + unittests: |
| 17 | + name: unittests |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v6 |
| 22 | + |
| 23 | + - name: Install system packages |
| 24 | + run: | |
| 25 | + sudo apt-get -qq update |
| 26 | + sudo apt-get install -yq libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev librocksdb-dev libleveldb-dev libboost-all-dev libsodium-dev |
| 27 | +
|
| 28 | + - uses: actions/setup-python@v6 |
| 29 | + with: |
| 30 | + python-version: '3.14' |
| 31 | + cache: 'pip' |
| 32 | + cache-dependency-path: 'pyproject.toml' |
| 33 | + |
| 34 | + - name: Log Python version and Git tag |
| 35 | + run: | |
| 36 | + python3 --version |
| 37 | + git tag |
| 38 | +
|
| 39 | + - name: Install Python deps |
| 40 | + run: | |
| 41 | + # test framework -related deps |
| 42 | + pip install pycodestyle |
| 43 | + pip install pytest-asyncio |
| 44 | + pip install pytest-cov |
| 45 | + pip install Sphinx |
| 46 | + # hacks for rocksdb |
| 47 | + pip install 'Cython<3.0' |
| 48 | + pip install git+https://github.com/jansegre/python-rocksdb.git@314572c02e7204464a5c3e3475c79d57870a9a03 |
| 49 | + # e-x itself |
| 50 | + pip install . |
| 51 | + # hashes and other altcoin-specific stuff |
| 52 | + pip install tribushashm |
| 53 | + pip install blake256 |
| 54 | + pip install dash_hash |
| 55 | + pip install git+https://github.com/bitcoinplusorg/x13-hash |
| 56 | + pip install xevan_hash |
| 57 | + pip install quark_hash |
| 58 | + pip install groestlcoin_hash |
| 59 | + pip install x16r_hash |
| 60 | + pip install pycryptodomex |
| 61 | + pip install git+https://github.com/Electra-project/nist5_hash |
| 62 | + pip install x16rv2_hash |
| 63 | +
|
| 64 | + - name: Run pytest |
| 65 | + run: pytest --cov=electrumx |
| 66 | + |
| 67 | + pycodestyle: |
| 68 | + name: pycodestyle |
| 69 | + runs-on: ubuntu-24.04 |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v6 |
| 72 | + |
| 73 | + - uses: actions/setup-python@v6 |
| 74 | + with: |
| 75 | + python-version: '3.14' |
| 76 | + cache: 'pip' |
| 77 | + |
| 78 | + - name: Install pycodestyle |
| 79 | + run: pip install pycodestyle |
| 80 | + |
| 81 | + - name: Run pycodestyle |
| 82 | + run: pycodestyle --max-line-length=100 src |
| 83 | + |
| 84 | + build_docs: |
| 85 | + # note: this build task is not related to read-the-docs; it is only here to sanity-check the docs can be built. |
| 86 | + # For the read-the-docs build, see .readthedocs.yml |
| 87 | + # and the webhook set up in https://github.com/spesmilo/electrumx/settings/hooks |
| 88 | + name: build_docs |
| 89 | + runs-on: ubuntu-24.04 |
| 90 | + env: |
| 91 | + LC_ALL: "C" |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v6 |
| 94 | + |
| 95 | + - uses: actions/setup-python@v6 |
| 96 | + with: |
| 97 | + python-version: '3.14' |
| 98 | + cache: 'pip' |
| 99 | + cache-dependency-path: 'docs/requirements-docs.txt' |
| 100 | + |
| 101 | + - name: Install docs deps |
| 102 | + run: pip install -r docs/requirements-docs.txt |
| 103 | + |
| 104 | + - name: Build docs |
| 105 | + run: | |
| 106 | + cd docs |
| 107 | + make html |
0 commit comments