-
Notifications
You must be signed in to change notification settings - Fork 15
149 lines (120 loc) · 5.1 KB
/
ci.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
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
linux:
strategy:
matrix:
os:
- { name: Ubuntu 20.04, distro: ubuntu-20.04, gcc_version: 9 }
- { name: Ubuntu 22.04, distro: ubuntu-22.04, gcc_version: 11 }
build_type: [Debug, Release]
toolchain: ["gcc-32bit", "gcc-64bit"]
name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.toolchain}}"
runs-on: ${{matrix.os.distro}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
shell: bash
run: sudo apt-get install gcc g++ gcc-multilib libstdc++-${{matrix.os.gcc_version}}-dev lib32stdc++-${{matrix.os.gcc_version}}-dev
- name: Create build environment
working-directory: ${{runner.workspace}}
run: mkdir build
- name: Initialize CMake
shell: bash
env:
CC: /usr/bin/gcc
CXX: /usr/bin/g++
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE=toolchains/${{matrix.toolchain}}.cmake
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: make
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -V -C ${{matrix.build_type}}
- name: Rename library artifact
run: mv ${{runner.workspace}}/build/src/libgluasteal.so ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-gcc${{matrix.os.gcc_version}}-${{matrix.toolchain}}-${{matrix.build_type}}.so
- uses: actions/upload-artifact@v3
with:
name: "Linux"
path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-gcc${{matrix.os.gcc_version}}-${{matrix.toolchain}}-${{matrix.build_type}}.so
if-no-files-found: error
retention-days: 14
windows:
strategy:
matrix:
os:
- { name: Windows Server 2019, distro: windows-2019 }
- { name: Windows Server 2022, distro: windows-2022 }
build_type: [Debug, Release]
arch: [Win32, x64]
name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.arch}}"
runs-on: ${{matrix.os.distro}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: Create build environment
working-directory: ${{runner.workspace}}
run: mkdir build
- name: Initialize CMake
working-directory: ${{runner.workspace}}/build
run: cmake -A ${{matrix.arch}} -DCMAKE_TOOLCHAIN_FILE=../toolchains/msvc.cmake $env:GITHUB_WORKSPACE
- name: Build
working-directory: ${{runner.workspace}}/build
run: msbuild gluasteal.sln /p:Configuration=${{matrix.build_type}} /p:Platform=${{matrix.arch == 'x86' && 'Win32' || matrix.arch}}
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -V -C ${{matrix.build_type}} --timeout 60
- name: Rename library artifact
run: move ${{runner.workspace}}/build/src/${{matrix.build_type}}/gluasteal.dll ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.arch}}-${{matrix.build_type}}.dll
- uses: actions/upload-artifact@v3
with:
name: "Windows"
path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.arch}}-${{matrix.build_type}}.dll
if-no-files-found: error
retention-days: 14
macos:
strategy:
matrix:
os:
- { name: "macOS Big Sur 11", distro: macos-11 }
- { name: "macOS Monterey 12", distro: macos-12 }
build_type: [Debug, Release]
toolchain: ["gcc-macos-x86_64"]
name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.toolchain}}"
runs-on: ${{matrix.os.distro}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build environment
working-directory: ${{runner.workspace}}
run: mkdir build
- name: Initialize CMake
env:
CC: /usr/bin/gcc
CXX: /usr/bin/g++
working-directory: ${{runner.workspace}}/build
run: cmake --debug-output $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE=toolchains/${{matrix.toolchain}}.cmake
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: make
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -V -C ${{matrix.build_type}}
- name: Rename library artifact
run: mv ${{runner.workspace}}/build/src/libgluasteal.dylib ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.toolchain}}-${{matrix.build_type}}.dylib
- uses: actions/upload-artifact@v3
with:
name: "macOS"
path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.toolchain}}-${{matrix.build_type}}.dylib
if-no-files-found: error
retention-days: 14