18
18
19
19
jobs :
20
20
build :
21
- # The CMake configure and build commands are platform agnostic and should work equally
22
- # well on Windows or Mac. You can convert this to a matrix build if you need
23
- # cross-platform coverage.
24
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
25
21
runs-on : ubuntu-latest
26
22
container : ubuntu:latest
27
23
@@ -91,91 +87,79 @@ jobs:
91
87
cmake .
92
88
cmake --build .
93
89
94
- build_2_8 :
95
- # The CMake configure and build commands are platform agnostic and should work equally
96
- # well on Windows or Mac. You can convert this to a matrix build if you need
97
- # cross-platform coverage.
98
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
90
+ build_linux :
91
+ strategy :
92
+ fail-fast : false
93
+ matrix :
94
+ cmake :
95
+ - 2.8.12.2
96
+ - 3.10.3
97
+ - latest
99
98
runs-on : ubuntu-latest
100
- container : ubuntu:14.04
99
+ container : ubuntu:latest
101
100
102
101
steps :
103
102
- uses : actions/checkout@v2
104
-
105
- - name : Install dependencies
106
- run : apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev
107
-
108
- - name : Configure CMake
109
- shell : bash
110
- run : cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
111
-
112
- - name : Build test
113
- shell : bash
114
- run : cmake --build .
115
-
116
- - name : Check alias
117
- shell : bash
118
- run : test -e lib/libGLEW.a
119
103
120
- build_3_10 :
121
- # The CMake configure and build commands are platform agnostic and should work equally
122
- # well on Windows or Mac. You can convert this to a matrix build if you need
123
- # cross-platform coverage.
124
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
125
- runs-on : ubuntu-latest
126
- container : ubuntu:18.04
104
+ - name : Restore cached cmake
105
+ uses : actions/cache/restore@v4
106
+ [<0;97;19M with :
107
+ path : /opt/cmake
108
+ key : cmake-${{ matrix.cmake }}
127
109
128
- steps :
129
- - uses : actions/checkout@v2
130
-
131
110
- name : Install dependencies
132
- run : apt update && apt install -y cmake gcc libgl1-mesa-dev libx11-dev libxext-dev
111
+ shell : bash
112
+ run : |
113
+ cmake=${{ matrix.cmake }}
114
+ apt update
115
+ apt install -y gcc make libgl1-mesa-dev libx11-dev libxext-dev
116
+ if [ -x /opt/cmake/bin/cmake ]; then
117
+ echo "Found cached cmake"
118
+ if [ -s "$(/opt/cmake/bin/cmake --version | grep ${cmake})" ]; then
119
+ exit 0
120
+ fi
121
+ echo "CMake version is mismatched"
122
+ rm -rf /opt/cmake
123
+ fi
124
+
125
+ apt install -y g++ wget
126
+ if [ "${cmake}" == "latest" ]; then
127
+ apt install -y git
128
+ cmake=$(git ls-remote --tags https://gitlab.kitware.com/cmake/cmake | cut -f 2 | sed -E "s/^refs\/tags\/v//" | tr -d "^{}" | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1 | tr -d "\n")
129
+ echo "Latest version: ${cmake}"
130
+ fi
131
+ short_version=$(echo "${cmake}" | sed -E "s/^([0-9]+\\.[0-9]+)\\..+$/\\1/" | tr -d "\n")
132
+ wget https://cmake.org/files/v${short_version}/cmake-${cmake}.tar.gz
133
+ tar -xf cmake-${cmake}.tar.gz
134
+ cd cmake-${cmake}
135
+ ./configure --prefix=/opt/cmake
136
+ make -j $(nproc) install
137
+
138
+ - name : Save cmake
139
+ uses : actions/cache/save@v4
140
+ with :
141
+ path : /opt/cmake
142
+ key : cmake-${{ matrix.cmake }}
133
143
134
144
- name : Configure CMake
135
145
shell : bash
136
- run : cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
146
+ run : /opt/cmake/bin/ cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
137
147
138
148
- name : Build test
139
149
shell : bash
140
- run : cmake --build .
141
-
142
- - name : Check alias
143
- shell : bash
144
- run : test -e lib/libGLEW.a
145
-
146
- build_latest :
147
- runs-on : ubuntu-latest
148
- container : ubuntu:latest
150
+ run : /opt/cmake/bin/cmake --build .
149
151
150
- steps :
151
- - uses : actions/checkout@v2
152
-
153
- - name : Install dependencies
154
- run : apt update && apt install -y python3 python3-pip gcc libgl1-mesa-dev libx11-dev libxext-dev && pip install cmake
155
-
156
- - name : Configure CMake
157
- shell : bash
158
- run : cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
159
-
160
- - name : Build test
161
- shell : bash
162
- run : cmake --build .
163
-
164
152
- name : Check alias
165
153
shell : bash
166
154
run : test -e lib/libGLEW.a
167
155
168
156
build_mingw :
169
- # The CMake configure and build commands are platform agnostic and should work equally
170
- # well on Windows or Mac. You can convert this to a matrix build if you need
171
- # cross-platform coverage.
172
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
173
157
runs-on : ubuntu-latest
174
- container : ubuntu:18.04
158
+ container : ubuntu:latest
175
159
176
160
steps :
177
161
- uses : actions/checkout@v2
178
-
162
+
179
163
- name : Install dependencies
180
164
run : apt update && apt install -y cmake g++-mingw-w64-x86-64 make libgl1-mesa-dev libx11-dev libxext-dev
181
165
@@ -193,7 +177,7 @@ jobs:
193
177
194
178
steps :
195
179
- uses : actions/checkout@v2
196
-
180
+
197
181
- name : Configure CMake
198
182
shell : bash
199
183
run : cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
@@ -207,7 +191,7 @@ jobs:
207
191
208
192
steps :
209
193
- uses : actions/checkout@v2
210
-
194
+
211
195
- name : Configure CMake
212
196
shell : bash
213
197
run : cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
0 commit comments