diff --git a/.github/workflows/ci-coverage.yml b/.github/workflows/ci-coverage.yml deleted file mode 100644 index 0562ccd..0000000 --- a/.github/workflows/ci-coverage.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: PR Diff Coverage - -on: - pull_request: - branches: [ main ] - -jobs: - diff-coverage: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Install Tarpaulin - run: cargo install cargo-tarpaulin --version 0.32.0 --force - - - name: Run Tarpaulin -> JSON summary - run: | - mkdir -p coverage - cargo tarpaulin \ - --out Json \ - --output-dir coverage \ - -- --test-threads=1 - - - name: Archive coverage JSON - uses: actions/upload-artifact@v4 - with: - name: coverage-summary - path: coverage/coverage-summary.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e16f91..ee3cada 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,24 +12,12 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - os: ubuntu-24.04-arm - target: aarch64-unknown-linux-gnu - os: ubuntu-24.04-arm target: armv7-unknown-linux-gnueabihf base_image: raspios_lite:latest - os: ubuntu-24.04-arm target: thumbv7neon-unknown-linux-gnueabihf base_image: raspios_lite:latest - - os: windows-latest - target: x86_64-pc-windows-msvc - - os: windows-11-arm - target: aarch64-pc-windows-msvc - - os: macos-latest - target: aarch64-apple-darwin runs-on: ${{ matrix.os }} name: Build & test on ${{ matrix.os }} / ${{ matrix.target }} @@ -87,6 +75,29 @@ jobs: cargo build --target ${{ matrix.target }} --release fi + - name: Build test binaries (ARM targets) + if: matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'thumbv7neon-unknown-linux-gnueabihf' + shell: bash + env: + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + OPENSSL_LIB_DIR: /usr/lib/arm-linux-gnueabihf + OPENSSL_INCLUDE_DIR: /usr/include/openssl + PKG_CONFIG_ALLOW_CROSS: 1 + PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig + run: | + cargo test --target ${{ matrix.target }} --no-run --release + + - name: Build test binaries (other targets) + if: matrix.target != 'armv7-unknown-linux-gnueabihf' && matrix.target != 'thumbv7neon-unknown-linux-gnueabihf' + shell: bash + run: | + if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" && "${{ matrix.os }}" == "ubuntu-latest" ]]; then + echo "skip" + else + cargo test --target ${{ matrix.target }} --no-run --release + fi + - name: Test (ARM targets) if: matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'thumbv7neon-unknown-linux-gnueabihf' shell: bash @@ -108,4 +119,41 @@ jobs: echo "skip" else cargo test --target ${{ matrix.target }} -- --nocapture - fi \ No newline at end of file + fi + + - name: Prepare test artifacts + if: always() + shell: bash + run: | + mkdir -p test-artifacts + # Copy test binaries (both debug and release) + if [ -d "target/${{ matrix.target }}/release/deps" ]; then + cp -r target/${{ matrix.target }}/release/deps test-artifacts/release-deps || true + fi + if [ -d "target/${{ matrix.target }}/debug/deps" ]; then + cp -r target/${{ matrix.target }}/debug/deps test-artifacts/debug-deps || true + fi + # Copy any test executables in examples + if [ -d "target/${{ matrix.target }}/release/examples" ]; then + cp -r target/${{ matrix.target }}/release/examples test-artifacts/release-examples || true + fi + if [ -d "target/${{ matrix.target }}/debug/examples" ]; then + cp -r target/${{ matrix.target }}/debug/examples test-artifacts/debug-examples || true + fi + # Create a build info file + echo "Target: ${{ matrix.target }}" > test-artifacts/build-info.txt + echo "OS: ${{ matrix.os }}" >> test-artifacts/build-info.txt + echo "Build Date: $(date)" >> test-artifacts/build-info.txt + echo "Rust Version: $(rustc --version)" >> test-artifacts/build-info.txt + echo "Cargo Version: $(cargo --version)" >> test-artifacts/build-info.txt + # List all files for debugging + find test-artifacts -type f > test-artifacts/file-list.txt + + - name: Upload test binaries + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-binaries-${{ matrix.target }}-${{ matrix.os }} + path: test-artifacts/ + retention-days: 1 + if-no-files-found: warn \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index ca92094..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Code Coverage - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - coverage-matrix: - name: Coverage on ${{ matrix.os }} / ${{ matrix.target }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - #- os: ubuntu-latest - # target: aarch64-unknown-linux-gnu - - os: windows-latest - target: x86_64-pc-windows-msvc - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - # Linux deps + QEMU for ARM64 - - name: Install Linux packages - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y llvm lcov qemu-user-static gcc-aarch64-linux-gnu binfmt-support - - - name: Enable QEMU binfmt - if: runner.os == 'Linux' - run: sudo update-binfmts --enable qemu-aarch64 - - - name: Verify QEMU installation - if: runner.os == 'Linux' - run: | - qemu-aarch64-static --version - echo "QEMU for ARM64 is properly configured." - - - name: Install cross - if: runner.os == 'Linux' - run: cargo install cross --locked - - # Windows LLVM - - name: Install LLVM on Windows - if: runner.os == 'Windows' - run: choco install llvm --no-progress - - # Nightly + llvm-cov - - name: Install Rust nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov --locked - - # Install the standard library for the chosen target - - name: Add Rust target - run: rustup target add ${{ matrix.target }} - - # Run coverage in one logical command (no backslashes) - - name: Run coverage - env: - RUSTFLAGS: "-C instrument-coverage" - CARGO_INCREMENTAL: "0" - shell: bash - run: | - cargo llvm-cov --branch --workspace --html --target ${{ matrix.target }} - - - name: Move HTML report - run: mv target/llvm-cov/html target/coverage-${{ matrix.os }}-${{ matrix.target }} - - - name: Upload HTML coverage report - uses: actions/upload-artifact@v4 - with: - name: html-report-${{ matrix.os }}-${{ matrix.target }} - path: target/coverage-${{ matrix.os }}-${{ matrix.target }} diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index 3f9bb4e..0000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build and Upload Doc - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-docs: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: Build documentation - run: cargo doc --no-deps - - - name: Upload documentation as artifact (main branch only) - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - uses: actions/upload-artifact@v4 - with: - name: rust-docs - path: target/doc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 8786ca7..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Publish to crates.io - -on: - workflow_dispatch: - push: - tags: - - 'v*.*.*' - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - environment: crates-io-publish - steps: - - uses: actions/checkout@v4 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Publish to crates.io - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - run: cargo publish --locked diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml deleted file mode 100644 index daae2d0..0000000 --- a/.github/workflows/rust-clippy.yml +++ /dev/null @@ -1,55 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# rust-clippy is a tool that runs a bunch of lints to catch common -# mistakes in your Rust code and help improve your Rust code. -# More details at https://github.com/rust-lang/rust-clippy -# and https://rust-lang.github.io/rust-clippy/ - -name: rust-clippy analyze - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '25 15 * * 3' - -jobs: - rust-clippy-analyze: - name: Run rust-clippy analyzing - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 - with: - profile: minimal - toolchain: stable - components: clippy - override: true - - - name: Install required cargo - run: cargo install clippy-sarif sarif-fmt - - - name: Run rust-clippy - run: - cargo clippy - --all-features - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: rust-clippy-results.sarif - wait-for-processing: true