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