-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (63 loc) · 2.47 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: test
on:
push:
branches: [ "main" ]
pull_request:
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
# CMake versions under test are the versions available int the supported
# lts versions of Ubuntu, and the latest version.
# Once support for a ubuntu version is dropped, the minimum cmake version of this
# project will be updated.
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release, Debug]
cmake_version: ['3.16.3', # 20.04 LTS
'3.22.1', # 22.04 LTS
'3.28.3', # 24.04 LTS
'3.30']
exclude:
- os: windows-latest
cmake_version: '3.16.3' # there seems to be a bug with compiler detection
steps:
- uses: actions/checkout@v4
- 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: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.cmake_version }}
- name: Print CMake version
run: cmake --version
- name: setup python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install spdx-tools
run: |
python -m pip install --upgrade pip
pip install spdx-tools
- name: Validate example sbom
run: |
pyspdxtools -i ${{ github.workspace }}/example/output/*.spdx
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
env:
CMAKE_VERSION: ${{ matrix.cmake_version }}
- name: Install
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target install
env:
CMAKE_VERSION: ${{ matrix.cmake_version }}