hgdhgfcvbncnb
Quick CI / quick-test (push) Failing after 1m16s
Multi-Platform CI / test-platforms (ubuntu-22.04) (push) Failing after 1m23s
Multi-Platform CI / test-platforms (windows-latest) (push) Failing after 1m21s
Multi-Platform CI / package (ubuntu-22.04) (push) Has been skipped
Multi-Platform CI / package (windows-latest) (push) Has been skipped
Quick CI / quick-test (push) Failing after 1m16s
Multi-Platform CI / test-platforms (ubuntu-22.04) (push) Failing after 1m23s
Multi-Platform CI / test-platforms (windows-latest) (push) Failing after 1m21s
Multi-Platform CI / package (ubuntu-22.04) (push) Has been skipped
Multi-Platform CI / package (windows-latest) (push) Has been skipped
This commit is contained in:
@@ -6,10 +6,6 @@ on:
|
||||
os:
|
||||
required: true
|
||||
type: string
|
||||
target:
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
upload-artifacts:
|
||||
required: false
|
||||
type: boolean
|
||||
@@ -24,60 +20,33 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy, rustfmt
|
||||
targets: ${{ inputs.target }}
|
||||
|
||||
- name: Install cross
|
||||
if: inputs.target != ''
|
||||
run: |
|
||||
cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
if [[ -n "${{ inputs.target }}" ]]; then
|
||||
cross build --all-features --target ${{ inputs.target }}
|
||||
else
|
||||
cargo build --all-features
|
||||
fi
|
||||
run: cargo build --all-features
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
if [[ -n "${{ inputs.target }}" ]]; then
|
||||
cross test --all-features --target ${{ inputs.target }}
|
||||
else
|
||||
cargo test --all-features
|
||||
fi
|
||||
run: cargo test --all-features
|
||||
|
||||
- name: Clippy
|
||||
run: |
|
||||
if [[ -n "${{ inputs.target }}" ]]; then
|
||||
cross clippy --all-targets --all-features --target ${{ inputs.target }} -- -D warnings
|
||||
else
|
||||
cargo clippy --all-targets --all-features -- -D warnings
|
||||
fi
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
- name: Fmt check
|
||||
run: |
|
||||
cargo fmt --all -- --check
|
||||
|
||||
- name: Benchmark (Linux only)
|
||||
if: runner.os == 'Linux' && inputs.target == ''
|
||||
run: |
|
||||
cargo bench --bench heart
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo bench --bench heart
|
||||
|
||||
- name: Security audit (Linux only)
|
||||
if: runner.os == 'Linux' && inputs.target == ''
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
cargo install cargo-audit
|
||||
cargo audit
|
||||
|
||||
- name: Build FFI library
|
||||
if: inputs.upload-artifacts
|
||||
run: |
|
||||
if [[ -n "${{ inputs.target }}" ]]; then
|
||||
cross build --release --features ffi --target ${{ inputs.target }}
|
||||
else
|
||||
cargo build --release --features ffi
|
||||
fi
|
||||
run: cargo build --release --features ffi
|
||||
|
||||
- name: Extract version and create package
|
||||
if: inputs.upload-artifacts
|
||||
@@ -86,18 +55,12 @@ jobs:
|
||||
VERSION=$(sed -n 's/^version\s*=\s*"\([^"]\+\)"/\1/p' Cargo.toml | head -n1)
|
||||
|
||||
# Determine target directory and library extension
|
||||
if [[ -n "${{ inputs.target }}" ]]; then
|
||||
TARGET_DIR="target/${{ inputs.target }}/release"
|
||||
PKG_BASENAME="medicallib_rust-v${VERSION}-${{ inputs.target }}"
|
||||
else
|
||||
TARGET_DIR="target/release"
|
||||
case "${{ runner.os }}" in
|
||||
Linux) PKG_BASENAME="medicallib_rust-v${VERSION}-x86_64-unknown-linux-gnu" ;;
|
||||
macOS) PKG_BASENAME="medicallib_rust-v${VERSION}-x86_64-apple-darwin" ;;
|
||||
Windows) PKG_BASENAME="medicallib_rust-v${VERSION}-x86_64-pc-windows-msvc" ;;
|
||||
*) PKG_BASENAME="medicallib_rust-v${VERSION}-native" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
PKG_DIR="dist/${PKG_BASENAME}"
|
||||
|
||||
@@ -129,5 +92,5 @@ jobs:
|
||||
if: inputs.upload-artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: medicallib-rust-${{ inputs.target || runner.os }}
|
||||
name: medicallib-rust-${{ runner.os }}
|
||||
path: dist/
|
||||
|
||||
@@ -5,32 +5,17 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
# Test on all platforms
|
||||
# Test on platforms with native builds only
|
||||
test-platforms:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Linux x86_64 target (may cross-compile on ARM runners)
|
||||
# Linux native
|
||||
- os: ubuntu-22.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
|
||||
# Windows native targets only
|
||||
# Windows native
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
uses: ./.gitea/workflows/ci-reusable.yml
|
||||
with:
|
||||
os: ${{ matrix.os }}
|
||||
target: ${{ matrix.target }}
|
||||
upload-artifacts: false
|
||||
|
||||
# Test native builds (no cross-compilation)
|
||||
test-native:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, windows-latest]
|
||||
|
||||
uses: ./.gitea/workflows/ci-reusable.yml
|
||||
with:
|
||||
@@ -40,17 +25,14 @@ jobs:
|
||||
# Package for distribution (only on master)
|
||||
package:
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
|
||||
needs: [test-platforms, test-native]
|
||||
needs: [test-platforms]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
uses: ./.gitea/workflows/ci-reusable.yml
|
||||
with:
|
||||
os: ${{ matrix.os }}
|
||||
target: ${{ matrix.target }}
|
||||
upload-artifacts: true
|
||||
|
||||
Reference in New Issue
Block a user