-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (78 loc) · 2.61 KB
/
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
81
82
83
name: CI
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- name: windows-gemini
runs-on: windows-latest
leapsdk-ref: windows-gemini
leapsdk-lib-path: LeapSDK/lib/x64
cargo-features: --features gemini
- name: windows-orion
runs-on: windows-latest
leapsdk-ref: windows-orion
leapsdk-lib-path: LeapSDK/lib/x64
cargo-features: ""
- name: linux-gemini
runs-on: ubuntu-latest
leapsdk-ref: linux-gemini
leapsdk-lib-path: ultraleap-hand-tracking-service
cargo-features: --features gemini
- name: macos-gemini
runs-on: macos-latest
leapsdk-ref: macos-silicon-gemini
leapsdk-lib-path: LeapSDK/lib
cargo-features: --features gemini
name: ${{ matrix.name }}
if: eq(${{ github.repository }}, "plule/leaprs") # no secrets in clones
runs-on: ${{ matrix.runs-on }}
env:
LEAPSDK_LIB_PATH: ${{ github.workspace }}/leap-sdk-redist/${{ matrix.leapsdk-lib-path }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
ref: ${{ matrix.leapsdk-ref }}
repository: plule/leap-sdk-redist
token: ${{ secrets.LEAP_SDK_REDIST_PAT }}
path: leap-sdk-redist
- uses: Swatinem/rust-cache@v1
- name: Build
run: cargo build --no-default-features --features nalgebra --features glam ${{ matrix.cargo-features }}
- name: Build Examples
run: cargo build --no-default-features --features nalgebra --features glam ${{ matrix.cargo-features }} --examples
- name: Build Tests
run: cargo build --no-default-features --features nalgebra --features glam ${{ matrix.cargo-features }} --tests
- name: Doc
run: cargo doc --features nalgebra --features glam
- name: Style
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings
release:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
- name: Publish crate
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}