-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 1.93 KB
/
ci.yaml
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
name: CI
on:
push:
env:
CARGO_TERM_COLOR: always
jobs:
dependencies:
name: Dependencies
runs-on: Ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo fetch
run: cargo fetch --verbose
init-matrix:
name: Initialize Matrix
runs-on: Ubuntu-24.04
needs: [dependencies]
outputs:
combinations: ${{ steps.combinations.outputs.combinations }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get combinations
id: combinations
run: |
echo "combinations=[$(find ./src/keyboard -not -name "mod.rs" -name "*.rs" | awk -F'/' '{sub(/\.rs$/, "", $6); print "{\"keyboard\": \""$4"\", \"layout\": \""$6"\"}"}' ORS="," | sed -e '$ s/,$//')]" >> "$GITHUB_OUTPUT"
build:
name: Build
runs-on: Ubuntu-24.04
needs: [init-matrix]
strategy:
matrix:
combination: ${{ fromJSON(needs.init-matrix.outputs.combinations) }}
env:
KEYBOARD: ${{ matrix.combination.keyboard }}
LAYOUT: ${{ matrix.combination.layout }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo build
run: cargo build --verbose
lint:
name: Lint
runs-on: Ubuntu-24.04
needs: [init-matrix]
strategy:
matrix:
combination: ${{ fromJSON(needs.init-matrix.outputs.combinations) }}
env:
KEYBOARD: ${{ matrix.combination.keyboard }}
LAYOUT: ${{ matrix.combination.layout }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo fmt
run: cargo fmt --all --check --verbose
- name: Cargo clippy
run: cargo clippy --verbose