From d48bacd29ba2bdd18ddd5b503f066b46ea8f3063 Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Wed, 8 Mar 2023 15:04:32 -0500 Subject: [PATCH] Streamline CI workflows --- .github/workflows/audit.yml | 2 +- .github/workflows/cont_integration.yml | 22 ++++++++++++++++++---- .github/workflows/publish-android.yaml | 4 ++-- .github/workflows/publish-jvm.yaml | 4 ++-- .github/workflows/publish-python.yaml | 2 +- .github/workflows/test-android.yaml | 12 ++++++------ .github/workflows/test-jvm.yaml | 4 ++-- .github/workflows/test-python.yaml | 10 +++++----- .github/workflows/test-swift.yaml | 2 +- 9 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index b170630c..b9cd8bcb 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -10,7 +10,7 @@ on: jobs: security_audit: - name: Security Audit + name: Security audit runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 63c29b47..f35a2bee 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -1,4 +1,4 @@ -name: bdk-ffi CI +name: Rust layer CI on: push: paths: @@ -10,7 +10,7 @@ on: jobs: build-test: name: Build and test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: rust: @@ -18,11 +18,13 @@ jobs: clippy: true - version: 1.61.0 # MSRV steps: - - name: checkout + - name: Checkout uses: actions/checkout@v2 + - name: Generate cache key run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key - - name: cache + + - name: Cache uses: actions/cache@v2 with: path: | @@ -30,20 +32,27 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + - name: Set default toolchain run: rustup default ${{ matrix.rust.version }} + - name: Set profile run: rustup set profile minimal + - name: Add clippy if: ${{ matrix.rust.clippy }} run: rustup component add clippy + - name: Update toolchain run: rustup update + - name: Build run: cargo build --features uniffi/cli + - name: Clippy if: ${{ matrix.rust.clippy }} run: cargo clippy --all-targets --features "uniffi/bindgen-tests uniffi/cli" -- -D warnings + - name: Test run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test --features uniffi/bindgen-tests,uniffi/cli @@ -53,13 +62,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Set default toolchain run: rustup default nightly + - name: Set profile run: rustup set profile minimal + - name: Add rustfmt run: rustup component add rustfmt + - name: Update toolchain run: rustup update + - name: Check fmt run: cargo fmt --all -- --config format_code_in_doc_comments=true --check diff --git a/.github/workflows/publish-android.yaml b/.github/workflows/publish-android.yaml index ebe1f712..632d438b 100644 --- a/.github/workflows/publish-android.yaml +++ b/.github/workflows/publish-android.yaml @@ -20,7 +20,7 @@ jobs: - name: Check out PR branch uses: actions/checkout@v2 - - name: cache + - name: Cache uses: actions/cache@v2 with: path: | @@ -35,7 +35,7 @@ jobs: distribution: temurin 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 - name: Build bdk-android library diff --git a/.github/workflows/publish-jvm.yaml b/.github/workflows/publish-jvm.yaml index 005b31f5..a72189ef 100644 --- a/.github/workflows/publish-jvm.yaml +++ b/.github/workflows/publish-jvm.yaml @@ -3,10 +3,10 @@ on: [workflow_dispatch] jobs: 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 steps: - - name: Checkout publishing branch + - name: "Checkout publishing branch" uses: actions/checkout@v2 - name: Cache diff --git a/.github/workflows/publish-python.yaml b/.github/workflows/publish-python.yaml index ba4d81ce..bb9da0aa 100644 --- a/.github/workflows/publish-python.yaml +++ b/.github/workflows/publish-python.yaml @@ -142,7 +142,7 @@ jobs: with: path: dist/ - # - name: 'Publish on test PyPI' + # - name: "Publish on test PyPI" # uses: pypa/gh-action-pypi-publish@release/v1 # with: # user: __token__ diff --git a/.github/workflows/test-android.yaml b/.github/workflows/test-android.yaml index 0544aab4..9a961408 100644 --- a/.github/workflows/test-android.yaml +++ b/.github/workflows/test-android.yaml @@ -18,17 +18,17 @@ jobs: build: runs-on: ubuntu-20.04 steps: - - name: Install Android NDK 21.4.7075529 + - name: "Install Android NDK 21.4.7075529" run: | ANDROID_ROOT=/usr/local/lib/android ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager echo "y" | $SDKMANAGER "ndk;21.4.7075529" - - name: Check out PR branch + - name: "Check out PR branch" uses: actions/checkout@v2 - - name: cache + - name: "Cache" uses: actions/cache@v2 with: path: | @@ -37,16 +37,16 @@ jobs: ./target key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Set up JDK + - name: "Set up JDK" uses: actions/setup-java@v2 with: distribution: temurin 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 - - name: Run Android tests + - name: "Run Android tests" run: | cd bdk-android ./gradlew test --console=rich diff --git a/.github/workflows/test-jvm.yaml b/.github/workflows/test-jvm.yaml index ceb2597a..643bf516 100644 --- a/.github/workflows/test-jvm.yaml +++ b/.github/workflows/test-jvm.yaml @@ -1,4 +1,4 @@ -name: Test JVM +name: Test Kotlin/JVM on: push: paths: @@ -16,7 +16,7 @@ jobs: - name: Check out PR branch uses: actions/checkout@v2 - - name: cache + - name: Cache uses: actions/cache@v2 with: path: | diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index c048be6c..2eed3433 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -52,13 +52,13 @@ jobs: - name: "Build wheel" run: ${PYBIN}/python setup.py bdist_wheel --verbose - - name: Install wheel + - name: "Install wheel" run: ${PYBIN}/pip install ./dist/*.whl - - name: Run tests + - name: "Run tests" run: ${PYBIN}/python -m unittest tests/test_bdk.py --verbose - - name: Upload artifact test + - name: "Upload artifact test" uses: actions/upload-artifact@v2 with: name: bdkpython-manylinux2014-x86_64-${{ matrix.python }} @@ -98,10 +98,10 @@ jobs: ARCHFLAGS: "-arch x86_64 -arch arm64" run: python3 setup.py bdist_wheel --verbose - - name: Install wheel + - name: "Install wheel" run: pip3 install ./dist/*.whl - - name: Run tests + - name: "Run tests" run: python3 -m unittest tests/test_bdk.py --verbose build-windows-wheel: diff --git a/.github/workflows/test-swift.yaml b/.github/workflows/test-swift.yaml index 784e8af2..18cfed53 100644 --- a/.github/workflows/test-swift.yaml +++ b/.github/workflows/test-swift.yaml @@ -13,7 +13,7 @@ jobs: build: runs-on: macos-12 steps: - - name: Checkout branch + - name: Checkout uses: actions/checkout@v2 - name: Install Rust targets