Streamline CI workflows

This commit is contained in:
thunderbiscuit 2023-03-08 15:04:32 -05:00
parent c1243f9e1c
commit d48bacd29b
No known key found for this signature in database
GPG Key ID: 88253696EB836462
9 changed files with 38 additions and 24 deletions

View File

@ -10,7 +10,7 @@ on:
jobs: jobs:
security_audit: security_audit:
name: Security Audit name: Security audit
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -1,4 +1,4 @@
name: bdk-ffi CI name: Rust layer CI
on: on:
push: push:
paths: paths:
@ -10,7 +10,7 @@ on:
jobs: jobs:
build-test: build-test:
name: Build and test name: Build and test
runs-on: ubuntu-latest runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
rust: rust:
@ -18,11 +18,13 @@ jobs:
clippy: true clippy: true
- version: 1.61.0 # MSRV - version: 1.61.0 # MSRV
steps: steps:
- name: checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Generate cache key - name: Generate cache key
run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
- name: cache
- name: Cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
@ -30,20 +32,27 @@ jobs:
~/.cargo/git ~/.cargo/git
target target
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain - name: Set default toolchain
run: rustup default ${{ matrix.rust.version }} run: rustup default ${{ matrix.rust.version }}
- name: Set profile - name: Set profile
run: rustup set profile minimal run: rustup set profile minimal
- name: Add clippy - name: Add clippy
if: ${{ matrix.rust.clippy }} if: ${{ matrix.rust.clippy }}
run: rustup component add clippy run: rustup component add clippy
- name: Update toolchain - name: Update toolchain
run: rustup update run: rustup update
- name: Build - name: Build
run: cargo build --features uniffi/cli run: cargo build --features uniffi/cli
- name: Clippy - name: Clippy
if: ${{ matrix.rust.clippy }} if: ${{ matrix.rust.clippy }}
run: cargo clippy --all-targets --features "uniffi/bindgen-tests uniffi/cli" -- -D warnings run: cargo clippy --all-targets --features "uniffi/bindgen-tests uniffi/cli" -- -D warnings
- name: Test - name: Test
run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test --features uniffi/bindgen-tests,uniffi/cli run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test --features uniffi/bindgen-tests,uniffi/cli
@ -53,13 +62,18 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set default toolchain - name: Set default toolchain
run: rustup default nightly run: rustup default nightly
- name: Set profile - name: Set profile
run: rustup set profile minimal run: rustup set profile minimal
- name: Add rustfmt - name: Add rustfmt
run: rustup component add rustfmt run: rustup component add rustfmt
- name: Update toolchain - name: Update toolchain
run: rustup update run: rustup update
- name: Check fmt - name: Check fmt
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check run: cargo fmt --all -- --config format_code_in_doc_comments=true --check

View File

@ -20,7 +20,7 @@ jobs:
- name: Check out PR branch - name: Check out PR branch
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
@ -35,7 +35,7 @@ jobs:
distribution: temurin distribution: temurin
java-version: 11 java-version: 11
- name: Install rust android targets - name: Install Rust Android targets
run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
- name: Build bdk-android library - name: Build bdk-android library

View File

@ -3,10 +3,10 @@ on: [workflow_dispatch]
jobs: jobs:
build-jvm-macOS-M1-native-lib: build-jvm-macOS-M1-native-lib:
name: Create M1 and x86_64 JVM native binaries name: "Create M1 and x86_64 JVM native binaries"
runs-on: macos-12 runs-on: macos-12
steps: steps:
- name: Checkout publishing branch - name: "Checkout publishing branch"
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Cache - name: Cache

View File

@ -142,7 +142,7 @@ jobs:
with: with:
path: dist/ path: dist/
# - name: 'Publish on test PyPI' # - name: "Publish on test PyPI"
# uses: pypa/gh-action-pypi-publish@release/v1 # uses: pypa/gh-action-pypi-publish@release/v1
# with: # with:
# user: __token__ # user: __token__

View File

@ -18,17 +18,17 @@ jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Install Android NDK 21.4.7075529 - name: "Install Android NDK 21.4.7075529"
run: | run: |
ANDROID_ROOT=/usr/local/lib/android ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
echo "y" | $SDKMANAGER "ndk;21.4.7075529" echo "y" | $SDKMANAGER "ndk;21.4.7075529"
- name: Check out PR branch - name: "Check out PR branch"
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: cache - name: "Cache"
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |
@ -37,16 +37,16 @@ jobs:
./target ./target
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set up JDK - name: "Set up JDK"
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
distribution: temurin distribution: temurin
java-version: 11 java-version: 11
- name: Install rust android targets - name: "Install Rust Android targets"
run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
- name: Run Android tests - name: "Run Android tests"
run: | run: |
cd bdk-android cd bdk-android
./gradlew test --console=rich ./gradlew test --console=rich

View File

@ -1,4 +1,4 @@
name: Test JVM name: Test Kotlin/JVM
on: on:
push: push:
paths: paths:
@ -16,7 +16,7 @@ jobs:
- name: Check out PR branch - name: Check out PR branch
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: | path: |

View File

@ -52,13 +52,13 @@ jobs:
- name: "Build wheel" - name: "Build wheel"
run: ${PYBIN}/python setup.py bdist_wheel --verbose run: ${PYBIN}/python setup.py bdist_wheel --verbose
- name: Install wheel - name: "Install wheel"
run: ${PYBIN}/pip install ./dist/*.whl run: ${PYBIN}/pip install ./dist/*.whl
- name: Run tests - name: "Run tests"
run: ${PYBIN}/python -m unittest tests/test_bdk.py --verbose run: ${PYBIN}/python -m unittest tests/test_bdk.py --verbose
- name: Upload artifact test - name: "Upload artifact test"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }} name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
@ -98,10 +98,10 @@ jobs:
ARCHFLAGS: "-arch x86_64 -arch arm64" ARCHFLAGS: "-arch x86_64 -arch arm64"
run: python3 setup.py bdist_wheel --verbose run: python3 setup.py bdist_wheel --verbose
- name: Install wheel - name: "Install wheel"
run: pip3 install ./dist/*.whl run: pip3 install ./dist/*.whl
- name: Run tests - name: "Run tests"
run: python3 -m unittest tests/test_bdk.py --verbose run: python3 -m unittest tests/test_bdk.py --verbose
build-windows-wheel: build-windows-wheel:

View File

@ -13,7 +13,7 @@ jobs:
build: build:
runs-on: macos-12 runs-on: macos-12
steps: steps:
- name: Checkout branch - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Rust targets - name: Install Rust targets