forked from medusalix/FreeMDU
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 970 Bytes
/
build.yml
File metadata and controls
34 lines (34 loc) · 970 Bytes
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
on:
workflow_call:
inputs:
dir:
type: string
target:
type: string
features:
type: string
test:
type: boolean
jobs:
rust:
name: Build & check
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.dir }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build crate
run: cargo build --target "${{ inputs.target }}" --features "${{ inputs.features }}" --release
- name: Format code
run: cargo fmt --check
- name: Lint code
run: cargo clippy --target "${{ inputs.target }}" --features "${{ inputs.features }}" -- -D warnings
- name: Run tests
run: cargo test --target "${{ inputs.target }}" --features "${{ inputs.features }}"
if: inputs.test