This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
80 lines (70 loc) · 2.59 KB
/
build-rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Rust
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-rust:
strategy:
fail-fast: false
matrix:
include:
- artifact-name: Rust Native - Windows x86_64 (CasADi)
optimizer_backend: casadi
os: windows-2022
rust-target: x86_64-pc-windows-gnu
- artifact-name: Rust Native - macOS x86_64 (CasADi)
optimizer_backend: casadi
os: macOS-13
rust-target: x86_64-apple-darwin
- artifact-name: Rust Native - macOS arm64 (CasADi)
optimizer_backend: casadi
os: macOS-14
rust-target: aarch64-apple-darwin
- artifact-name: Rust Native - Linux x86_64 (CasADi)
optimizer_backend: casadi
os: ubuntu-latest
rust-target: x86_64-unknown-linux-gnu
- artifact-name: Rust Native - Windows x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: windows-2022
rust-target: x86_64-pc-windows-msvc
- artifact-name: Rust Native - macOS x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: macOS-13
rust-target: x86_64-apple-darwin
- artifact-name: Rust Native - macOS arm64 (Sleipnir)
optimizer_backend: sleipnir
os: macOS-14
rust-target: aarch64-apple-darwin
- artifact-name: Rust Native - Linux x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: ubuntu-latest
rust-target: x86_64-unknown-linux-gnu
name: "${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up MinGW
if: matrix.os == 'windows-2022' && matrix.optimizer_backend == 'casadi'
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
version: 11.2.0
static: 0
- name: Set up Rust
uses: hecrj/setup-rust-action@v1
with:
targets: ${{matrix.rust-target}}
- name: Set up Clang
if: ${{ !startsWith(matrix.os, 'macOS') }}
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Build Rust
working-directory: rust
run: cargo build --target ${{ matrix.rust-target }} --features ${{ matrix.optimizer_backend }}
- name: Run Rust
working-directory: rust
run: cargo run --example swerve --target ${{ matrix.rust-target }} --features ${{ matrix.optimizer_backend }}