Skip to content

Update test-ci.yml

Update test-ci.yml #9

Workflow file for this run

name: TestCI
on:
push:
branches:
- test-ci
jobs:
build-java-jni:
strategy:
fail-fast: true
matrix:
settings:
- host: ubuntu-latest
lib_prefix: "lib"
lib_suffix: ".so"
target: x86_64-unknown-linux-gnu
cross-target: x86_64-unknown-linux-gnu:centos
- host: ubuntu-latest
lib_prefix: "lib"
lib_suffix: ".so"
target: aarch64-unknown-linux-gnu
cross-target: aarch64-unknown-linux-gnu
- host: windows-latest
lib_suffix: ".dll"
target: x86_64-pc-windows-msvc
- host: macos-13
lib_prefix: "lib"
lib_suffix: ".dylib"
target: x86_64-apple-darwin
- host: macos-13
lib_prefix: "lib"
lib_suffix: ".dylib"
target: aarch64-apple-darwin
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
target: ${{ matrix.settings.target }}
- name: Build
if: ${{ matrix.settings.cross-target == '' }}
run: |
cargo build -p longport-java --release --target ${{ matrix.settings.target }}
mv target/${{ matrix.settings.target }}/release/${{ matrix.settings.lib_prefix }}longport_java${{ matrix.settings.lib_suffix }} longport_java-${{ matrix.settings.target }}${{ matrix.settings.lib_suffix }}
- name: Install Cross
if: ${{ matrix.settings.cross-target != '' }}
run: cargo install cross
- name: Build with Cross
if: ${{ matrix.settings.cross-target != '' }}
run: |
cross build -p longport-java --release --target ${{ matrix.settings.cross-target }}
mv target/${{ matrix.settings.target }}/release/${{ matrix.settings.lib_prefix }}longport_java${{ matrix.settings.lib_suffix }} longport_java-${{ matrix.settings.target }}${{ matrix.settings.lib_suffix }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: jnis
path: longport_java-${{ matrix.settings.target }}${{ matrix.settings.lib_suffix }}