-
Notifications
You must be signed in to change notification settings - Fork 9
155 lines (131 loc) · 4.28 KB
/
cmake.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# SPDX-License-Identifier: GPL-3.0-only
#
name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
html-docs:
runs-on: ubuntu-latest
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
submodules: true
- name: Set Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run Workflow
run: cmake --workflow --preset ci-html-docs
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup AsciiDoctor
uses: reitzig/actions-asciidoctor@v2.0.2
with:
version: 2.0.18
- name: AsciiDoctor version
run: asciidoctor --version
- name: Run AsciiDoctor
run: asciidoctor build-ci-html-docs/hc/src/id.adoc
- name: Upload HTML artifact
uses: actions/upload-artifact@v4
with:
name: html-docs
path: ${{github.workspace}}/build-ci-html-docs/hc/src/id.html
build:
needs: html-docs
strategy:
matrix:
preset: [ debug, release ]
# macos-latest is disabled for now
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{matrix.os}}
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
submodules: true
- name: Set Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Get HTML documentation
uses: actions/download-artifact@v4
with:
name: html-docs
- name: Run Workflow
run: cmake --workflow --preset ci-${{matrix.preset}}
- name: Upload msi package artifacts
uses: actions/upload-artifact@v4
if: ${{matrix.os == 'windows-latest'}}
with:
name: Msi-${{matrix.preset}}
path: ${{github.workspace}}/build-ci-${{matrix.preset}}/*.msi
compression-level: 0
- name: Upload zip package artifacts
uses: actions/upload-artifact@v4
if: ${{matrix.os == 'windows-latest'}}
with:
name: Zip-${{matrix.preset}}
path: ${{github.workspace}}/build-ci-${{matrix.preset}}/*.zip
compression-level: 0
- name: Upload tar.gz package artifacts
uses: actions/upload-artifact@v4
if: ${{matrix.os == 'ubuntu-latest'}}
with:
name: Tar-${{matrix.preset}}
path: ${{github.workspace}}/build-ci-${{matrix.preset}}/*.tar.gz
compression-level: 0
cppcheck:
name: cppcheck
runs-on: ubuntu-latest
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.1
with:
submodules: true
- name: Set Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Configure Compilation Database
run: cmake --preset cppcheck
- name: Run CppCheck
uses: deep5050/cppcheck-action@v3.0
with:
github_token: ${{secrets.GITHUB_TOKEN}}
enable: 'style'
force: 'enable'
other_options: >-
--suppress=commaSeparatedReturn
--suppress=cstyleCast
--suppress=functionStatic
--suppress=incorrectStringBooleanError
--suppress=invalidPointerCast
--suppress=invalidscanf
--suppress=variableHidingEnum
--suppress=variableScope
--inline-suppr
-I headers hc common headers unix win32
-ifractint
-ivcpkg
-i../build-cppcheck/vcpkg_installed
- name: Print Report
run: cmake -E cat cppcheck_report.txt