-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (125 loc) · 6.73 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
name: CMake
on:
push: # Keep empty to run on each branch when push the code. Otherwise use branches: [ master ]
branches: [ main ]
pull_request: # Set to master to run only when merge with master branch
branches: [ main ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CYGWIN: winsymlinks:native
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Linux.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
jobs:
linux-build:
name: Build with GNU and LLVM compilers on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/[email protected]
with:
java-version: 17
java-package: jre
distribution: temurin
- name: Update Linux
# Update compilers, set C/C++ compilers
run: sudo apt-get update
- name: Configure and run areg-sdk-demo on Linux with GNU family
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-gnu/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./linux-gnu" -DAREG_COMPILER_FAMILY=gnu -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-gnu -j 20
- name: Configure and run areg-sdk-demo on Linux with g++ compiler
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-g++/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./linux-g++" -DAREG_COMPILER=g++ -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-g++/cache -j 20
- name: Configure and run areg-sdk-demo on Linux with gcc compiler
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-gcc/cache -DINTEGRATE_AREG_BEFORE_PROJECT=FALSE -DAREG_BUILD_ROOT="./linux-gcc" -DAREG_COMPILER=gcc -DAREG_BINARY=static -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-gcc/cache -j 20
- name: Configure and run areg-sdk-demo on Linux with LLVM family
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-llvm/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./linux-llvm" -DAREG_COMPILER_FAMILY=llvm -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-llvm/cache -j 20
- name: Configure and run areg-sdk-demo on Linux with clang++ compiler
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-clang++/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./linux-clang++" -DAREG_COMPILER=clang++ -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-clang++/cache -j 20
- name: Configure and run areg-sdk-demo on Linux with clang compiler
working-directory: ${{github.workspace}}
run: |
cmake -B ./linux-clang/cache -DINTEGRATE_AREG_BEFORE_PROJECT=FALSE -DAREG_BUILD_ROOT="./linux-clang" -DAREG_COMPILER=clang -DAREG_BINARY=static -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./linux-clang/cache -j 20
windows-build:
name: Build with MSVC compilers on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/[email protected]
with:
java-version: 17
java-package: jre
distribution: temurin
- name: Configure and run areg-sdk-demo on Windows with MSVC family
working-directory: ${{github.workspace}}
run: |
cmake -B ./windows-msvc/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./windows-msvc" -DAREG_COMPILER_FAMILY=msvc -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./windows-msvc/cache -j 20
- name: Configure and run areg-sdk-demo on Windows with CL compiler
working-directory: ${{github.workspace}}
run: |
cmake -B ./windows-cl/cache -DINTEGRATE_AREG_BEFORE_PROJECT=FALSE -DAREG_BUILD_ROOT="./windows-cl" -DAREG_COMPILER=cl -DAREG_BINARY=static -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./windows-cl/cache -j 20
cygwin-build:
name: Build with GNU compilers on Cygwin
runs-on: windows-latest
env:
CYGWIN: winsymlinks:native
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/[email protected]
with:
java-version: 17
java-package: jre
distribution: temurin
- uses: cygwin/cygwin-install-action@master
with:
packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make
- name: Update Cygwin
shell: powershell
run: |
# (https://github.com/cygwin/cygwin-install-action/blob/master/action.yml)
Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe
# because setup is a Windows GUI app, make it part of a pipeline to make
# PowerShell wait for it to exit
& C:\setup.exe -qgnO -t | Out-Default
- name: Configure and run areg-sdk-demo on Cygwin with GNU family
working-directory: ${{github.workspace}}
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
run: |
cmake -B ./cygwin-gnu/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./cygwin-gnu" -DAREG_COMPILER_FAMILY=cygwin -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./cygwin-gnu/cache -j 20
- name: Configure and run areg-sdk-demo on cygwin with g++ compiler
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
working-directory: ${{github.workspace}}
run: |
cmake -B ./cygwin-g++/cache -DINTEGRATE_AREG_BEFORE_PROJECT=TRUE -DAREG_BUILD_ROOT="./cygwin-g++" -DAREG_COMPILER=g++ -DAREG_BINARY=share -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./cygwin-g++/cache -j 20
- name: Configure and run areg-sdk-demo on Cygwin with gcc compiler
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
working-directory: ${{github.workspace}}
run: |
cmake -B ./cygwin-gcc/cache -DINTEGRATE_AREG_BEFORE_PROJECT=FALSE -DAREG_BUILD_ROOT="./cygwin-gcc" -DAREG_COMPILER=gcc -DAREG_BINARY=static -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ./cygwin-gcc/cache -j 20