Skip to content

Commit

Permalink
Merge pull request #3061 from CounterpartyXCP/develop
Browse files Browse the repository at this point in the history
v10.10.1
  • Loading branch information
ouziel-slama authored Mar 3, 2025
2 parents 993866c + 0a2ac97 commit 18de91c
Show file tree
Hide file tree
Showing 181 changed files with 11,878 additions and 10,817 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/bandit_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Bandit Scanner

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Bandit:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bandit Scan
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
with: # optional arguments
exit_zero: true # optional, default is DEFAULT
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information.
excluded_paths: "*/test/*,*/counterparty-core/tools/*" # optional, default is DEFAULT
skips: "B101" # optional, default is DEFAULT
35 changes: 35 additions & 0 deletions .github/workflows/codeql_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Codeql Scanner

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Codeql:
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
17 changes: 17 additions & 0 deletions .github/workflows/functionals_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Functionals Test

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Functionals:
uses: ./.github/workflows/pytest_action.yml
with:
name: Functionals
test-path: functionals
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pytest
name: Integrations Test

on:
push:
Expand All @@ -9,30 +9,14 @@ concurrency:
cancel-in-progress: true

jobs:
Test:
Integrations:
strategy:
fail-fast: false
# define the matrix
matrix:

# Units tests

name: ["Units And Functionals"]
python-version: ["3.10", "3.11", "3.12"]
os: ["ubuntu-22.04", "macos-14"]
test-path: ["units counterpartycore/test/functionals"]
include:

- name: Units And Functionals
test-path: units counterpartycore/test/functionals
python-version: 3.13
os: ubuntu-22.04

- name: Units And Functionals
test-path: units counterpartycore/test/functionals
python-version: 3.13
os: macos-14

# Mainnet tests

# bootstrap, run the server with --api-only and run
Expand All @@ -41,6 +25,7 @@ jobs:
test-path: integrations/load_test.py
os: Linux-Large-1
only_on_develop: true
no_cov_report: true

# bootstrap, reparse 1000 blocks,
# rollback 3 checkpoints and catchup
Expand All @@ -57,17 +42,18 @@ jobs:
test-path: integrations/regtest/scenarios_test.py
install_bitcoin: true

# run property tests on regtest
- name: Property Test
test-path: integrations/regtest/property_test.py
install_bitcoin: true

# Testnet4 tests

# bootstrap, reparse 1000 blocks,
# rollback 3 checkpoints and catchup
- name: Testnet4 Bootstrap And Catchup
test-path: integrations/testnet4_test.py
test-path: integrations/testnet4_test.py

- name: Testnet4 Start and Shutdown
test-path: integrations/shutdown_test.py

- name: Testnet4 Rebuild
test-path: integrations/rebuild_test.py

# Other tests

Expand All @@ -79,13 +65,16 @@ jobs:
- name: Compare Hashes
test-path: integrations/comparehashes_test.py

- name: RSFetcher Test
test-path: integrations/rsfetcher_test.py

# run pytest_action.yml for the matrix
uses: ./.github/workflows/pytest_action.yml
with:
name: ${{ matrix.name }} (${{ matrix.os }} - Python ${{ matrix.python-version }})
name: ${{ matrix.name }}
test-path: ${{ matrix.test-path }}
os: ${{ matrix.os || 'ubuntu-22.04' }}
python-version: ${{ matrix.python-version || '3.11' }}
install_bitcoin: ${{ matrix.install_bitcoin || false }}
only_on_develop: ${{ matrix.only_on_develop || false }}
os: ${{ matrix.os || 'ubuntu-22.04' }}
no_cov_report: ${{ matrix.no_cov_report || false }}
secrets: inherit
29 changes: 29 additions & 0 deletions .github/workflows/licenses_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Licenses Scanner

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install license_scanner sh
- name: Analysing dependencies with licence_scanner
run: |
python counterparty-core/tools/checklicences.py
- name: Upload SARIF
uses: github/codeql-action/upload-sarif/@v2
with:
sarif_file: license_scanner.sarif
18 changes: 18 additions & 0 deletions .github/workflows/property_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Property Test

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Property:
uses: ./.github/workflows/pytest_action.yml
with:
name: Property Test
test-path: integrations/regtest/property_test.py
install_bitcoin: true
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/pylint_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pylint Scanner

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade pylint pylint-sarif-unofficial
cd counterparty-rs && pip install -e . && cd ..
cd counterparty-core && pip install -e . && cd ..
- name: Analysing the code with pylint
run: |
pylint2sarif $(git ls-files '*.py' | grep -v counterparty-rs/tests/ | grep -v counterparty-core/counterpartycore/test/ | grep -v counterparty-core/tools/) || true
- name: Upload SARIF
uses: github/codeql-action/upload-sarif/@v2
with:
sarif_file: pylint.sarif
18 changes: 9 additions & 9 deletions .github/workflows/pytest_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ on:
install_bitcoin:
type: boolean
default: false
run_coveralls:
type: boolean
default: true
only_on_develop:
type: boolean
default: false
no_cov_report:
type: boolean
default: false

jobs:
pytest:
Expand All @@ -47,10 +47,7 @@ jobs:

- name: Install dependencies
run: |
# pip install --upgrade pytest hatchling==1.25.0 hatch==1.13.0 pytest-cov coveralls
pip install --upgrade pytest hatchling hatch pytest-cov coveralls
# cd counterparty-rs && pip install -e . && cd ..
# cd counterparty-core && pip install -e . && cd ..
- name: Install Bitcoin & Electrs
if: inputs.install_bitcoin
Expand All @@ -61,15 +58,18 @@ jobs:
sudo cp bitcoin-28.0/bin/bitcoind /usr/local/bin/bitcoind
sudo cp bitcoin-28.0/bin/bitcoin-wallet /usr/local/bin/bitcoin-wallet
npm install dredd --global
rustup toolchain install 1.83-x86_64-unknown-linux-gnu
git clone https://github.com/mempool/electrs && cd electrs
cargo install --path=.
- name: Run tests
run: |
cd counterparty-core
hatch run pytest counterpartycore/test/${{ inputs.test-path }} -s -vv -x \
--cov=counterpartycore/lib --cov-report=term-missing --cov-report=
mv .coverage ../
hatch run pytest counterpartycore/test/${{ inputs.test-path }} \
${{ !inputs.no_cov_report && '-s -vv -x --cov=counterpartycore/lib --cov-report=term-missing --cov-report=' || '' }}
if [ "${{ !inputs.no_cov_report }}" = "true" ]; then
mv .coverage ../
fi
- name: Upload coverage
uses: codecov/codecov-action@v5
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ruff_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Ruff Scanner

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "format --check"
version: 0.9.7
- uses: chartboost/ruff-action@v1
with:
version: 0.9.7
27 changes: 27 additions & 0 deletions .github/workflows/rust_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Rust Test

on:
push:
branches: "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Cargo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true

- name: Run tests
run: |
cd counterparty-rs
cargo test
Loading

1 comment on commit 18de91c

@adamkrellenstein
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiary.manifest contains reference to non-existent file in repository. (Autogenerated message from apiary.io)

  • apiary.apib

Please sign in to comment.