name: CI on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ${{ matrix.os }} env: PKG_CONFIG_PATH: "/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig" strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: [stable] steps: - uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - name: Cache cargo uses: actions/cache@v4 with: path: ~/.cargo/registry key: ${{ runner.os }}-cargo-registry-${{ matrix.rust }} - name: Install system packages (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libusb-1.0-0-dev pkg-config libudev-dev - name: Install system packages (macOS) if: matrix.os == 'macos-latest' run: | brew update || true brew install libusb pkg-config || true - name: Debug: pkg-config & libusb (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | mkdir -p ci-diagnostics echo "=== PKG_CONFIG & libusb diagnostic ===" | tee ci-diagnostics/pkgconfig-ubuntu.txt echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" | tee -a ci-diagnostics/pkgconfig-ubuntu.txt which pkg-config || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt pkg-config --version || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt pkg-config --modversion libusb-1.0 || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt pkg-config --cflags --libs libusb-1.0 || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt echo "\nFiles under /usr/lib*/pkgconfig (matching libusb)" | tee -a ci-diagnostics/pkgconfig-ubuntu.txt ls -la /usr/lib*/pkgconfig | grep libusb || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt echo "\nList files from libusb-dev package (first 50 lines):" | tee -a ci-diagnostics/pkgconfig-ubuntu.txt dpkg -L libusb-1.0-0-dev | head -n 50 || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt echo "\nldconfig output for libusb (if available):" | tee -a ci-diagnostics/pkgconfig-ubuntu.txt ldconfig -p | grep libusb || true | tee -a ci-diagnostics/pkgconfig-ubuntu.txt - name: Debug: pkg-config & libusb (macOS) if: matrix.os == 'macos-latest' run: | mkdir -p ci-diagnostics echo "=== PKG_CONFIG & libusb diagnostic (macOS) ===" | tee ci-diagnostics/pkgconfig-macos.txt echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" | tee -a ci-diagnostics/pkgconfig-macos.txt which pkg-config || true | tee -a ci-diagnostics/pkgconfig-macos.txt pkg-config --version || true | tee -a ci-diagnostics/pkgconfig-macos.txt pkg-config --modversion libusb-1.0 || true | tee -a ci-diagnostics/pkgconfig-macos.txt ls -la /opt/homebrew/lib/pkgconfig /usr/local/lib/pkgconfig || true | tee -a ci-diagnostics/pkgconfig-macos.txt brew list --versions libusb || true | tee -a ci-diagnostics/pkgconfig-macos.txt - name: Debug: Cargo.lock (key deps) run: | mkdir -p ci-diagnostics echo "=== Cargo.lock entries for key crates ===" > ci-diagnostics/cargo-lock-entries.txt grep -nE 'bdk|bip39|bip32|bitcoin|rusqlite|hidapi|aes-gcm|rusqlite' Cargo.lock >> ci-diagnostics/cargo-lock-entries.txt || true - name: Debug: cargo metadata & dependency tree run: | mkdir -p ci-diagnostics echo "RUSTC:" > ci-diagnostics/cargo-metadata.txt rustc --version >> ci-diagnostics/cargo-metadata.txt || true echo "CARGO:" >> ci-diagnostics/cargo-metadata.txt cargo --version >> ci-diagnostics/cargo-metadata.txt || true echo "\n=== cargo metadata (top-level) ===" >> ci-diagnostics/cargo-metadata.txt cargo metadata --no-deps --format-version 1 >> ci-diagnostics/cargo-metadata.txt || true echo "\n=== cargo tree (dependencies, depth=2) ===" >> ci-diagnostics/cargo-metadata.txt cargo tree --edges normal --depth 2 >> ci-diagnostics/cargo-metadata.txt || true - name: Upload CI diagnostics (always) if: always() uses: actions/upload-artifact@v4 with: name: cryptec-ci-diagnostics path: ci-diagnostics/** - name: Build run: cargo build --workspace --verbose - name: Run Rust tests run: cargo test --workspace --verbose - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' - name: Run Node integration tests (bindings) working-directory: ./bindings run: | npm ci || true npm test shell: bash