diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 6143cca..7a3cb07 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -12,8 +12,11 @@ jobs: security_audit: runs-on: ubuntu-20.04 + defaults: + run: + working-directory: bdk-ffi steps: - uses: actions/checkout@v2 - uses: actions-rs/audit-check@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-python-wheels.yaml b/.github/workflows/build-python-wheels.yaml index 7e905d1..8528fda 100644 --- a/.github/workflows/build-python-wheels.yaml +++ b/.github/workflows/build-python-wheels.yaml @@ -1,5 +1,5 @@ name: Build Python wheels -on: +on: push: paths: - "bdk-ffi/**" @@ -18,6 +18,9 @@ jobs: build-manylinux2014-x86_64-wheel: name: 'Build Manylinux 2014 x86_64 wheel' runs-on: ubuntu-latest + defaults: + run: + working-directory: bdk-python container: image: quay.io/pypa/manylinux2014_x86_64 env: @@ -42,21 +45,13 @@ jobs: with: toolchain: stable - name: install requirements - run: | - cd bdk-python - ${PYBIN}/pip install -r requirements.txt + run: ${PYBIN}/pip install -r requirements.txt - name: generate bindings - run: | - cd bdk-python - bash generate.sh + run: bash generate.sh - name: build wheel - run: | - cd bdk-python - ${PYBIN}/pip wheel . --no-deps -w /tmp/wheelhouse + run: ${PYBIN}/pip wheel . --no-deps -w /tmp/wheelhouse - name: repair wheel - run: | - cd bdk-python - auditwheel repair /tmp/wheelhouse/* --plat "$PLAT" -w /tmp/wheelhouse-repaired + run: auditwheel repair /tmp/wheelhouse/* --plat "$PLAT" -w /tmp/wheelhouse-repaired - uses: actions/upload-artifact@v2 with: name: bdkpython-manylinux2014-x86_64-${{ matrix.python }} @@ -65,6 +60,9 @@ jobs: build-macos-universal-wheel: name: 'Build macOS universal wheel' runs-on: macos-latest + defaults: + run: + working-directory: bdk-python strategy: matrix: python: @@ -73,30 +71,22 @@ jobs: # - '3.9' - '3.10' steps: - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - run: python3 --version - name: checkout uses: actions/checkout@v2 with: submodules: true + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: python3 --version - run: rustup target add aarch64-apple-darwin - - run: | - cd bdk-python - pip3 install --user -r requirements.txt - - run: | - cd bdk-python - pip3 install --user wheel - - run: | - cd bdk-python - bash generate.sh + - run: pip3 install --user -r requirements.txt + - run: pip3 install --user wheel + - run: bash generate.sh - name: build wheel env: ARCHFLAGS: "-arch x86_64 -arch arm64" - run: | - cd bdk-python - python3 setup.py -v bdist_wheel + run: python3 setup.py -v bdist_wheel - uses: actions/upload-artifact@v2 with: name: bdkpython-macos-${{ matrix.python }} @@ -105,6 +95,9 @@ jobs: build-windows-wheel: name: 'Build windows wheel' runs-on: windows-latest + defaults: + run: + working-directory: bdk-python strategy: matrix: python: @@ -113,28 +106,20 @@ jobs: # - '3.9' - '3.10' steps: - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - run: python --version - name: checkout uses: actions/checkout@v2 with: submodules: true - - run: | - cd bdk-python - pip install --user -r requirements.txt - - run: | - cd bdk-python - bash generate.sh + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: python --version + - run: pip install --user -r requirements.txt + - run: bash generate.sh shell: bash - - run: | - cd bdk-python - pip install --user wheel + - run: pip install --user wheel - name: build wheel - run: | - cd bdk-python - python setup.py -v bdist_wheel + run: python setup.py -v bdist_wheel - uses: actions/upload-artifact@v2 with: name: bdkpython-win-${{ matrix.python }} diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 6a63943..70d390d 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -12,6 +12,9 @@ jobs: build-test: name: Build and test runs-on: ubuntu-latest + defaults: + run: + working-directory: bdk-ffi strategy: matrix: rust: @@ -41,22 +44,19 @@ jobs: - name: Update toolchain run: rustup update - name: Build - run: | - cd bdk-ffi - cargo build + run: cargo build - name: Clippy if: ${{ matrix.rust.clippy }} - run: | - cd bdk-ffi - cargo clippy --all-targets -- -D warnings + run: cargo clippy --all-targets -- -D warnings - name: Test - run: | - cd bdk-ffi - CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test + run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test fmt: name: Rust fmt runs-on: ubuntu-latest + defaults: + run: + working-directory: bdk-ffi steps: - name: Checkout uses: actions/checkout@v2 @@ -69,6 +69,4 @@ jobs: - name: Update toolchain run: rustup update - name: Check fmt - run: | - cd bdk-ffi - cargo fmt --all -- --config format_code_in_doc_comments=true --check + run: cargo fmt --all -- --config format_code_in_doc_comments=true --check diff --git a/.github/workflows/publish-python.yaml b/.github/workflows/publish-python.yaml index de38004..ad4b4d3 100644 --- a/.github/workflows/publish-python.yaml +++ b/.github/workflows/publish-python.yaml @@ -10,6 +10,9 @@ jobs: build-manylinux2014-x86_64-wheel: name: 'Build Manylinux 2014 x86_64 wheel' runs-on: ubuntu-latest + defaults: + run: + working-directory: bdk-python container: image: quay.io/pypa/manylinux2014_x86_64 env: @@ -34,21 +37,13 @@ jobs: with: toolchain: stable - name: install requirements - run: | - cd bdk-python - ${PYBIN}/pip install -r requirements.txt + run: ${PYBIN}/pip install -r requirements.txt - name: generate bindings - run: | - cd bdk-python - bash generate.sh + run: bash generate.sh - name: build wheel - run: | - cd bdk-python - ${PYBIN}/pip wheel . --no-deps -w /tmp/wheelhouse + run: ${PYBIN}/pip wheel . --no-deps -w /tmp/wheelhouse - name: repair wheel - run: | - cd bdk-python - auditwheel repair /tmp/wheelhouse/* --plat "$PLAT" -w /tmp/wheelhouse-repaired + run: auditwheel repair /tmp/wheelhouse/* --plat "$PLAT" -w /tmp/wheelhouse-repaired - uses: actions/upload-artifact@v2 with: name: bdkpython-manylinux2014-x86_64-${{ matrix.python }} @@ -57,6 +52,9 @@ jobs: build-macos-universal-wheel: name: 'Build macOS universal wheel' runs-on: macos-latest + defaults: + run: + working-directory: bdk-python strategy: matrix: python: @@ -65,30 +63,22 @@ jobs: - '3.9' - '3.10' steps: - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - run: python3 --version - name: checkout uses: actions/checkout@v2 with: submodules: true + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: python3 --version - run: rustup target add aarch64-apple-darwin - - run: | - cd bdk-python - pip3 install --user -r requirements.txt - - run: | - cd bdk-python - pip3 install --user wheel - - run: | - cd bdk-python - bash generate.sh + - run: pip3 install --user -r requirements.txt + - run: pip3 install --user wheel + - run: bash generate.sh - name: build wheel env: ARCHFLAGS: "-arch x86_64 -arch arm64" - run: | - cd bdk-python - python3 setup.py -v bdist_wheel + run: python3 setup.py -v bdist_wheel - uses: actions/upload-artifact@v2 with: name: bdkpython-macos-${{ matrix.python }} @@ -97,6 +87,9 @@ jobs: build-windows-wheel: name: 'Build windows wheel' runs-on: windows-latest + defaults: + run: + working-directory: bdk-python strategy: matrix: python: @@ -105,28 +98,20 @@ jobs: - '3.9' - '3.10' steps: - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - run: python --version - name: checkout uses: actions/checkout@v2 with: submodules: true - - run: | - cd bdk-python - pip install --user -r requirements.txt - - run: | - cd bdk-python - bash generate.sh + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: python --version + - run: pip install --user -r requirements.txt + - run: bash generate.sh shell: bash - - run: | - cd bdk-python - pip install --user wheel + - run: pip install --user wheel - name: build wheel - run: | - cd bdk-python - python setup.py -v bdist_wheel + run: python setup.py -v bdist_wheel - uses: actions/upload-artifact@v2 with: name: bdkpython-win-${{ matrix.python }} @@ -135,17 +120,20 @@ jobs: publish-pypi: name: 'Publish on PyPI' runs-on: ubuntu-latest + defaults: + run: + working-directory: bdk-python needs: [build-manylinux2014-x86_64-wheel, build-macos-universal-wheel, build-windows-wheel] # needs: [build-macos-universal-wheel] steps: - name: Checkout uses: actions/checkout@v2 - + - name: 'Download artifacts in dist/ directory' uses: actions/download-artifact@v2 with: path: dist/ - + # - name: Display structure of downloaded files # run: ls -R