CI #172
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: --no-default-features --features nalgebra --features glam --features gemini | |
- name: windows-orion | |
runs-on: windows-latest | |
leapsdk-ref: windows-orion | |
leapsdk-lib-path: LeapSDK/lib/x64 | |
cargo-features: --no-default-features --features nalgebra --features glam | |
name: build | |
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 ${{ matrix.cargo-features }} | |
- name: Build Examples | |
run: cargo build ${{ matrix.cargo-features }} --examples | |
- name: Build Tests | |
run: cargo build ${{ 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 }} |