-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (55 loc) · 1.94 KB
/
linux_build.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
name: linux-build
on:
pull_request:
workflow_dispatch:
jobs:
check-diff:
runs-on: ubuntu-latest
outputs:
handle: ${{ steps.check.outputs.run }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 2
# The goal is to force this to pass if it does not need to run.
- name: Check the diff
id: check
run: |
echo "Here are the changed build/C files:"
echo "$(git --no-pager diff --name-only HEAD HEAD~1 | grep -E '\.(c|h)$|\.cmake|CMakeLists|Config\.cmake\.in')"
if git --no-pager diff --name-only HEAD HEAD~1 | grep -qE '\.(c|h)$|\.cmake|CMakeLists|Config\.cmake\.in'; then
echo "run=true" >> $GITHUB_OUTPUT
echo "Implementation and/or build files have changed, rebuilding..."
else
echo "run=false" >> $GITHUB_OUTPUT
echo "Implementation and/or build files have NOT changed, skipping build..."
fi
build:
runs-on: ubuntu-latest
needs: check-diff
if: ${{ needs.check-diff.outputs.handle == 'true' }}
steps:
- name: Sanity Check
run: |
echo "${{ needs.check-diff.outputs.handle }}"
- name: Checkout code
uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
- name: Build Debug Clang and Ninja
run: |
cmake --preset=clang-deb -G "Ninja" && cmake --build build --target ccc tests samples
cmake --build build --target install
- name: Test Debug
run: |
make dtest
- name: Build Release Clang and Ninja
run: |
make clean
cmake --preset=clang-rel -G "Ninja" && cmake --build build --target ccc tests samples
cmake --build build --target install
- name: Test Release
run: |
make rtest