diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1725535 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + +jobs: + backend: + name: Backend checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: "3.11" + cache: pip + cache-dependency-path: | + backend/requirements.txt + backend/conf/requirements-testing.txt + backend/conf/requirements-development.txt + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r backend/requirements.txt + python -m pip install -r backend/conf/requirements-testing.txt + python -m pip install -r backend/conf/requirements-development.txt + python -m pip install -e backend/litecoin_scrypt + + - name: Compile-check Python sources + run: python backend/dev/python3_port_compile_check.py + + - name: Ruff fatal-error gate + run: ruff check --select E9,F63,F7,F82 backend/p2pool backend/run_p2pool.py run_p2pool.py + + - name: Unit tests + working-directory: backend + run: python -m twisted.trial p2pool.test.test_data p2pool.test.test_node p2pool.test.bitcoin.test_data + + - name: Python dependency audit + run: | + pip-audit -r backend/requirements.txt + pip-audit -r backend/conf/requirements-testing.txt + pip-audit -r backend/conf/requirements-development.txt + + - name: Bandit medium/high security gate + run: bandit -q --severity-level medium -r backend/p2pool backend/run_p2pool.py run_p2pool.py -x backend/p2pool/test + + frontend: + name: Frontend dependency audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: "22" + - name: Retire.js audit + run: npx --yes retire --path frontend/web-static --outputformat text diff --git a/.gitignore b/.gitignore index d446220..d189430 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,23 @@ *.pyc *.pyo *~ +__pycache__/ /data/ /litecoin_scrypt/build/ +/backend/litecoin_scrypt/build/ /_trial_temp* +_trial_temp*/ Makefile.local .cache/ +.pytest_cache/ +.ruff_cache/ .pkglist .pyenv/ .coverage build/ +backend/build/ ltc_scrypt.so +backend/ltc_scrypt.so -.DS_Store \ No newline at end of file +.DS_Store diff --git a/README.md b/README.md index 50e4e36..f824eec 100644 --- a/README.md +++ b/README.md @@ -1,243 +1,110 @@ -Requirements: -========================= -To use P2Pool, you must be running your own local defcoind. It takes a while to sync so get that started first. +
+
+
+
+
+
+