57 lines
No EOL
1.4 KiB
YAML
57 lines
No EOL
1.4 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "master" ]
|
|
pull_request:
|
|
branches: [ "main", "master" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
arch: [x86_64, aarch64]
|
|
include:
|
|
- arch: x86_64
|
|
target: x86_64-unknown-linux-gnu
|
|
- arch: aarch64
|
|
target: aarch64-unknown-linux-gnu
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Install cross-compilation tools
|
|
if: matrix.arch == 'aarch64'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
|
|
|
- name: Build
|
|
run: cargo build --release --target ${{ matrix.target }}
|
|
env:
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
|
|
- name: Run tests
|
|
run: cargo test --verbose --target ${{ matrix.target }}
|
|
env:
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Zenyx-${{ runner.os }}-${{ matrix.arch }}-binary
|
|
path: |
|
|
target/${{ matrix.target }}/release/*.exe
|
|
target/${{ matrix.target }}/release/*[^.]* |