-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (50 loc) · 1.65 KB
/
cmake-multi-platform.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
name: CMake/Build/Test on multiple platforms
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
# Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
c_compiler: [gcc, clang]
exclude:
- os: windows-latest
c_compiler: clang
- os: macos-latest
c_compiler: gcc
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs.
# These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake Generator for Windows
if: runner.os == 'Windows'
run: |
echo CMAKE_GENERATOR="MinGW Makefiles" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: CMake
run: >
cmake
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-B ${{ steps.strings.outputs.build-output-dir }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
- name: Smoke Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
shell: bash
run: |
./grblHAL_validator -h
./grblHAL_sim -h