Compare commits
4 Commits
main
...
151-pyadb_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e111d03e4d | ||
|
|
0e24117678 | ||
|
|
8e89aa0d6e | ||
|
|
f0ed96cbd5 |
45
.github/workflows/python-build.yml
vendored
45
.github/workflows/python-build.yml
vendored
@@ -9,8 +9,17 @@ on:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
# ============================
|
||||
# BUILD (multi-architecture)
|
||||
# ============================
|
||||
build-python-packages:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [x86_64, arm64]
|
||||
|
||||
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -23,16 +32,34 @@ jobs:
|
||||
- name: Build Python packages
|
||||
run: maturin build --sdist --release -m pyadb_client/Cargo.toml
|
||||
|
||||
- name: Publish Python packages
|
||||
if: github.event_name == 'release' && github.event.action == 'created'
|
||||
run: maturin publish -m pyadb_client/Cargo.toml --non-interactive
|
||||
- name: Upload wheels as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-${{ matrix.arch }}
|
||||
path: target/wheels/*
|
||||
if-no-files-found: error
|
||||
|
||||
# ================================
|
||||
# PUBLISH (release creation only)
|
||||
# ================================
|
||||
publish:
|
||||
name: Publish to PyPI & GitHub Release
|
||||
if: github.event_name == 'release' && github.event.action == 'created'
|
||||
needs: build-python-packages
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download all wheels
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: wheels
|
||||
|
||||
- name: Publish Python packages to PyPI
|
||||
run: maturin publish wheels/**/*.whl --non-interactive
|
||||
env:
|
||||
MATURIN_PYPI_TOKEN: ${{ secrets.MATURIN_PYPI_TOKEN }}
|
||||
|
||||
- name: "Publish GitHub artefacts"
|
||||
if: github.event_name == 'release' && github.event.action == 'created'
|
||||
- name: Publish GitHub release artifacts
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
target/wheels/pyadb_client*.whl
|
||||
target/wheels/pyadb_client*.tar.gz
|
||||
files: wheels/**/*.*
|
||||
|
||||
22
.github/workflows/rust-build.yml
vendored
22
.github/workflows/rust-build.yml
vendored
@@ -6,24 +6,6 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Build on ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- name: Build project
|
||||
run: cargo build --release --all-features
|
||||
build-release:
|
||||
uses: cocool97/action_templates/.github/workflows/rust-build.yml@main
|
||||
|
||||
39
.github/workflows/rust-quality.yml
vendored
39
.github/workflows/rust-quality.yml
vendored
@@ -6,41 +6,6 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
name: "clippy"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: rustup component add clippy
|
||||
- name: Run clippy
|
||||
run: cargo clippy --all-features -- -Dwarnings
|
||||
|
||||
fmt:
|
||||
name: "fmt"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run formatter
|
||||
run: cargo fmt --all --check
|
||||
|
||||
doc:
|
||||
name: "doc"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run doc
|
||||
run: cargo doc --all-features --no-deps
|
||||
env:
|
||||
RUSTDOCFLAGS: "-D warnings"
|
||||
|
||||
tests:
|
||||
name: "tests"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run tests
|
||||
run: cargo test --verbose --all-features
|
||||
quality:
|
||||
uses: cocool97/action_templates/.github/workflows/rust-quality.yml@main
|
||||
|
||||
@@ -126,7 +126,7 @@ fn set_bit(n: usize) -> Result<BigUint> {
|
||||
|
||||
#[test]
|
||||
fn test_pubkey_gen() {
|
||||
const DEFAULT_PRIV_KEY: &'static str = r"-----BEGIN PRIVATE KEY-----
|
||||
const DEFAULT_PRIV_KEY: &str = r"-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4Dyn85cxDJnjM
|
||||
uYXQl/w469MDKdlGdviLfmFMWeYLVfL2Mz1AVyvKqscrtlhbbgMQ/M+3lDvEdHS0
|
||||
14RIGAwWRtrlTTmhLvM2/IO+eSKSYeCrCVc4KLG3E3WRryUXbs2ynA29xjTJVw+Z
|
||||
|
||||
@@ -107,6 +107,7 @@ fn test_static_devices_long() {
|
||||
"QQ20131020250511 device 20-4 product:NOH-AN00 model:NOH_AN00 device:HWNOH transport_id:3",
|
||||
];
|
||||
for input in inputs {
|
||||
DeviceLong::try_from(input.as_bytes()).expect(&format!("cannot parse input: '{input}'"));
|
||||
DeviceLong::try_from(input.as_bytes())
|
||||
.unwrap_or_else(|_| panic!("cannot parse input: '{input}'"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user