From 01783f63d57fba301d9f54fe1d4d765bf587959c Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 11 Nov 2023 07:41:46 +0000 Subject: [PATCH] improve pylint workflow, add build workflow --- .github/build-requirements.txt | 2 ++ .github/workflows/build.yaml | 42 ++++++++++++++++++++++++++++++++++ .github/workflows/pylint.yaml | 23 ++++++++++++++----- README.md | 3 ++- mmgen/data/version | 2 +- test-requirements.txt | 3 +++ 6 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 .github/build-requirements.txt create mode 100644 .github/workflows/build.yaml create mode 100644 test-requirements.txt diff --git a/.github/build-requirements.txt b/.github/build-requirements.txt new file mode 100644 index 00000000..97123c75 --- /dev/null +++ b/.github/build-requirements.txt @@ -0,0 +1,2 @@ +build +wheel diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..57aa7389 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,42 @@ +name: build + +on: + push: + paths: + - '.github/workflows/build.yaml' + - '**.py' + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.9","3.10","3.11"] + + steps: + - uses: actions/checkout@v4 + + - name: Cache libsecp256k1 repository + id: cache-libsecp256k1 + uses: actions/cache@v3 + env: + cache-name: cache-libsecp256k1 + with: + path: ~/.cache/mmgen/secp256k1 + key: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + .github/build-requirements.txt + setup.cfg + + - name: Build and install MMGen Wallet + run: | + python3 -m pip install build wheel + python3 -m build --no-isolation + python3 -m pip install --user --break-system-packages dist/*.whl diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml index 43d297fa..7b1f7d8a 100644 --- a/.github/workflows/pylint.yaml +++ b/.github/workflows/pylint.yaml @@ -1,6 +1,10 @@ -name: Pylint +name: pylint -on: push +on: + push: + paths: + - '.github/workflows/pylint.yaml' + - '**.py' jobs: test: @@ -11,12 +15,18 @@ jobs: python-version: ["3.9","3.10","3.11"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + setup.cfg + eth-requirements.txt + xmr-requirements.txt + test-requirements.txt - name: Install Python dependencies run: | @@ -24,9 +34,10 @@ jobs: python3 -m pip install pycryptodomex pysocks pycoin ipaddress varint pylint python3 -m pip install --no-deps py_ecc==1.6.0 mypy_extensions==0.4.1 monero - - name: Check the code with pylint static code analyzer + - name: Check the code with Pylint static code analyzer + env: + PYTHONPATH: . run: | - export PYTHONPATH=. pylint --errors-only mmgen pylint --errors-only test pylint --errors-only --disable=relative-beyond-top-level test/cmdtest_py_d diff --git a/README.md b/README.md index 3442eb6b..37fec8ff 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ ##### An online/offline cryptocurrency wallet for the command line -![Pylint](https://github.com/mmgen/mmgen/workflows/Pylint/badge.svg) +![build](https://github.com/mmgen/mmgen/workflows/build/badge.svg) +![pylint](https://github.com/mmgen/mmgen/workflows/pylint/badge.svg) ### Description diff --git a/mmgen/data/version b/mmgen/data/version index 6e48c174..04bf7588 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -14.0.dev14 +14.0.dev15 diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..62a7aacb --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +pycoin +monero +pylint