Skip to content

Update test-ci.yml

Update test-ci.yml #7

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
container: centos:7
lib_prefix: "lib"
lib_suffix: ".so"
target: x86_64-unknown-linux-gnu
# - host: ubuntu-latest
# lib_prefix: "lib"
# lib_suffix: ".so"
# 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 }}
container: ${{ matrix.settings.container }}
steps:
- name: Install Git & Gcc
if: ${{ contains(matrix.settings.container, 'centos') }}
run: |
# yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y git gcc
- 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.target != 'aarch64-unknown-linux-gnu' }}
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: Build with Cross
if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }}
run: |
cargo install cross
cross 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: Upload artifact
uses: actions/upload-artifact@v2
with:
name: jnis
path: longport_java-${{ matrix.settings.target }}${{ matrix.settings.lib_suffix }}