-
Notifications
You must be signed in to change notification settings - Fork 30
44 lines (37 loc) · 1.01 KB
/
Check.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
name: Check
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
check:
name: Determine Rust or C check
runs-on: ubuntu-latest
outputs:
is_rust: ${{ steps.check_type.outputs.is_rust }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Determine Rust or C check
id: check_type
run: |
PREV_SHA=$(git rev-parse HEAD^)
if git diff --name-only $PREV_SHA ${{ github.sha }} | \
grep -qE '^(rust/|board/100ask-d1-h-rs/)'; then
echo "::set-output name=is_rust::true"
else
echo "::set-output name=is_rust::false"
fi
rust_check:
name: Rust
needs: check
if: ${{ needs.check.outputs.is_rust == 'true' }}
uses: ./.github/workflows/Cargo.yml
cmake_check:
name: CMake
needs: check
if: ${{ needs.check.outputs.is_rust == 'false' }}
uses: ./.github/workflows/CMake.yml