-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 2.97 KB
/
Copy pathcmake-multi-platform.yml
File metadata and controls
109 lines (94 loc) · 2.97 KB
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
---
# vim:set sw=2 ts=8 et fileencoding=utf8:
# SPDX-License-Identifier: BSD-2-Clause
# SPDX-FileCopyrightText: 2026 Сергей Леонтьев (leo@sai.msu.ru)
name: CMake on multiple platforms
on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
branches: [main]
# env:
# VERBOSE: 1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
version: [11.0.2, 12.0.2, 13.01-git-lfs, 14.10-git-lfs]
os: [windows-latest, windows-2022]
c_compiler: ['', pocc]
build_type: [Release]
generator: ["MSYS Makefiles"]
# cmake_add: [--debug-trycompile]
exclude:
- {version: 11.0.2, os: windows-latest}
- {version: 11.0.2, c_compiler: ''}
- {version: 12.0.2, os: windows-latest}
include:
- version: 13.01-git-lfs
os: windows-latest
c_compiler: cc # One test with `-DCMAKE_C_COMPILER=cc`
build_type: Release
generator: "MSYS Makefiles"
steps:
- uses: actions/checkout@v6
- name: Lint
if: matrix.c_compiler == 'cc' # One test
run: |
python -m pip install yamllint
python -m yamllint --list-file .
python -m yamllint .
- name: Test action (Setup Pelles C for CMake)
uses: ./
with:
version: ${{ matrix.version }}
verbose: true
# location: # Default of installer: `C:\Program Files\PellesC`
# env-workaround: true # Needed workaround
# cache: false
- name: Check compiler
working-directory: ./tests
run: |
if ("" -eq "${{ matrix.c_compiler }}") {
$cc = "cc"
} else {
$cc = "${{ matrix.c_compiler }}"
}
&$cc -Ifirst -Isecond -DTEST_DEFINITIONS `
"-DTEST_DEFINITIONS_VAL=\042Test_1917\042" hello.c
if ("cc" -ne $cc) {
polink hello.obj
}
.\hello.exe
del hello.obj,hello.exe
- name: Configure CMake
run: |
cmake -B build `
${{ case(matrix.c_compiler == '', '',
format('-DCMAKE_C_COMPILER={0}', matrix.c_compiler)) }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
-G "${{ matrix.generator }}" `
-S . `
${{ matrix.cmake_add }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
--test-dir build
- name: Run Windows
run: |
cd build\tests
.\hello
.\bsd_echo my args
- name: Check 32-bit
shell: cmd
run: |
set LIB=
call povars32.bat
if errorlevel 1 exit /b
call clean-build.bat
if errorlevel 1 exit /b
call run-build-test.bat
if errorlevel 1 exit /b