11name : CI
22
3- on : [push, pull_request, workflow_dispatch]
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+ inputs :
8+ tools_windows_msvc_branch :
9+ description : " Windows MSVC dependencies branch (leave empty to use latest pre-built release)"
10+ required : false
11+
12+ env :
13+ APT_PACKAGES : >-
14+ pkg-config
15+ libgnutls28-dev
16+ libffi-dev
17+ libicu-dev
18+ libxml2-dev
19+ libxslt1-dev
20+ libssl-dev
21+ libavahi-client-dev
22+ zlib1g-dev
23+ gnutls-bin
24+ libcurl4-gnutls-dev
25+
26+ # packages for GCC Objective-C runtime
27+ APT_PACKAGES_gcc : >-
28+ libobjc-10-dev
29+ libblocksruntime-dev
30+ gobjc
31+
32+ # packages for libobjc2 / libdispatch
33+ APT_PACKAGES_clang : >-
34+ libpthread-workqueue-dev
435
536jobs :
6- ci :
37+ # ########## Linux ###########
38+ linux :
739 name : ${{ matrix.name }}
8- runs-on : ${{ matrix.os }}
40+ runs-on : ubuntu-latest
941 # don't run pull requests from local branches twice
1042 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
1143
1244 strategy :
1345 fail-fast : false
1446 matrix :
1547 include :
16- - name : Ubuntu GCC
17- os : ubuntu-latest
48+ - name : Ubuntu x64 GCC
1849 library-combo : gnu-gnu-gnu
1950 CC : gcc
2051 CXX : g++
2152
22- - name : Ubuntu Clang gnustep-1.9
23- os : ubuntu-latest
53+ - name : Ubuntu x64 Clang gnustep-1.9
2454 library-combo : ng-gnu-gnu
2555 runtime-version : gnustep-1.9
2656 CC : clang
2757 CXX : clang++
2858
29- - name : Ubuntu Clang gnustep-2.0
30- os : ubuntu-latest
59+ - name : Ubuntu x64 Clang gnustep-2.0
3160 library-combo : ng-gnu-gnu
3261 runtime-version : gnustep-2.0
3362 CC : clang
3463 CXX : clang++
3564
36- - name : Windows MinGW GCC i686
65+ env :
66+ SRC_PATH : ${{ github.workspace }}/source
67+ DEPS_PATH : ${{ github.workspace }}/dependencies
68+ INSTALL_PATH : ${{ github.workspace }}/build
69+ CC : ${{ matrix.CC }}
70+ CXX : ${{ matrix.CXX }}
71+ LIBRARY_COMBO : ${{ matrix.library-combo }}
72+ RUNTIME_VERSION : ${{ matrix.runtime-version }}
73+
74+ defaults :
75+ run :
76+ working-directory : ${{ env.SRC_PATH }}
77+
78+ steps :
79+ - uses : actions/checkout@v3
80+ with :
81+ path : ${{ env.SRC_PATH }}
82+
83+ - name : Install packages
84+ run : |
85+ sudo apt-get -q -y update
86+ sudo apt-get -q -y install $APT_PACKAGES $APT_PACKAGES_${{ matrix.library-combo == 'ng-gnu-gnu' && 'clang' || 'gcc' }}
87+
88+ # gnustep-2.0 runtime requires ld.gold or lld
89+ if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then
90+ sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10
91+ fi
92+
93+ - name : Install dependencies
94+ run : ./.github/scripts/dependencies.sh
95+
96+ - name : Build source
97+ run : |
98+ . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh
99+ ./configure
100+ make && make install
101+
102+ - name : Run tests
103+ run : |
104+ . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh
105+ make check
106+
107+ - name : Upload logs
108+ uses : actions/upload-artifact@v3
109+ if : always()
110+ with :
111+ name : Logs - ${{ matrix.name }}
112+ path : |
113+ ${{ env.SRC_PATH }}/config.log
114+ ${{ env.SRC_PATH }}/Tests/tests.log
115+
116+
117+ # ########## Windows ###########
118+ windows :
119+ name : ${{ matrix.name }}
120+ runs-on : windows-2019
121+ # don't run pull requests from local branches twice
122+ if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
123+
124+ strategy :
125+ fail-fast : false
126+ matrix :
127+ include :
128+ - name : Windows x86 MinGW GCC
37129 allow-test-failures : true
38- os : windows-2019
39130 arch : i686
40131 msystem : MINGW32
41132 library-combo : gnu-gnu-gnu
42133 CC : gcc
43134 CXX : g++
44135
45- - name : Windows MinGW GCC x86_64
46- os : windows-2019
136+ - name : Windows x64 MinGW GCC
47137 arch : x86_64
48138 msystem : MINGW64
49139 library-combo : gnu-gnu-gnu
50140 CC : gcc
51141 CXX : g++
52142
53- - name : Windows MSVC Clang gnustep-2.0 i686
143+ - name : Windows x86 MSVC Clang gnustep-2.0
54144 allow-test-failures : true
55- os : windows-2019
56145 arch : x86
57146 host : i686-pc-windows
58147 library-combo : ng-gnu-gnu
62151 CXX : clang++ -m32
63152 LDFLAGS : -fuse-ld=lld
64153
65- - name : Windows MSVC Clang gnustep-2.0 x86_64
66- os : windows-2019
154+ - name : Windows x64 MSVC Clang gnustep-2.0
67155 arch : x64
68156 host : x86_64-pc-windows
69157 library-combo : ng-gnu-gnu
@@ -74,11 +162,10 @@ jobs:
74162 LDFLAGS : -fuse-ld=lld
75163
76164 env :
77- SRC_PATH : ${{ github.workspace }}${{ startsWith(matrix.os, 'windows') && '\' || '/' }}source
78- DEPS_PATH : ${{ github.workspace }}${{ startsWith(matrix.os, 'windows') && '\' || '/' }}dependencies
79- INSTALL_PATH : ${{ github.workspace }}${{ startsWith(matrix.os, 'windows') && '\' || '/' }}build
80- IS_WINDOWS_MINGW : ${{ startsWith(matrix.os, 'windows') && startsWith(matrix.msystem, 'MINGW') }}
81- IS_WINDOWS_MSVC : ${{ startsWith(matrix.os, 'windows') && endsWith(matrix.host, '-pc-windows') }}
165+ SRC_PATH : ${{ github.workspace }}\source
166+ DEPS_PATH : ${{ github.workspace }}\dependencies
167+ INSTALL_PATH : ${{ github.workspace }}\build
168+ IS_WINDOWS_MSVC : ${{ endsWith(matrix.host, '-pc-windows') }}
82169 CC : ${{ matrix.CC }}
83170 CXX : ${{ matrix.CXX }}
84171 LDFLAGS : ${{ matrix.LDFLAGS }}
@@ -93,39 +180,17 @@ jobs:
93180
94181 defaults :
95182 run :
96- shell : ${{ startsWith(matrix.os, 'windows') && ' msys2 {0}' || 'bash' } }
183+ shell : msys2 {0}
97184 working-directory : ${{ env.SRC_PATH }}
98185
99186 steps :
100- - uses : actions/checkout@v2
187+ - uses : actions/checkout@v3
101188 with :
102189 path : ${{ env.SRC_PATH }}
103190
104- - name : Install packages (Linux)
105- if : runner.os == 'Linux'
106- run : |
107- PACKAGES="cmake pkg-config libgnutls28-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev gnutls-bin libcurl4-gnutls-dev"
108- case $LIBRARY_COMBO in
109- gnu-gnu-gnu)
110- # GCC Objective-C runtime
111- PACKAGES="$PACKAGES libobjc-9-dev libblocksruntime-dev gobjc"
112- ;;
113- ng-gnu-gnu)
114- # packages for libdispatch
115- PACKAGES="$PACKAGES libkqueue-dev libpthread-workqueue-dev"
116- # gnustep-2.0 runtime requires ld.gold or lld
117- if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then
118- sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10
119- fi
120- ;;
121- esac
122-
123- sudo apt-get update
124- sudo apt-get install $PACKAGES
125-
126- - name : Set up MSYS2 (Windows MinGW)
191+ - name : Set up MSYS2 (MinGW)
127192 uses : msys2/setup-msys2@v2
128- if : env.IS_WINDOWS_MINGW == 'true'
193+ if : ${{ startsWith(matrix.msystem, 'MINGW') }}
129194 with :
130195 msystem : ${{ matrix.msystem }}
131196 install : >
@@ -145,7 +210,7 @@ jobs:
145210 mingw-w64-${{matrix.arch}}-gnutls
146211 mingw-w64-${{matrix.arch}}-icu
147212
148- - name : Set up MSYS2 (Windows MSVC)
213+ - name : Set up MSYS2 (MSVC)
149214 uses : msys2/setup-msys2@v2
150215 if : env.IS_WINDOWS_MSVC == 'true'
151216 with :
@@ -154,35 +219,47 @@ jobs:
154219 # make Windows packages like Clang available in MSYS
155220 path-type : inherit
156221
157- - name : Delete MinGW gmake (Windows MSVC)
222+ - name : Delete MinGW gmake (MSVC)
158223 if : env.IS_WINDOWS_MSVC == 'true'
159224 # delete /c/Strawberry/c/bin/gmake built for MinGW that is found on runners, because we must use make built for MSYS
160225 run : if GMAKE_PATH=`which gmake`; then rm -f "$GMAKE_PATH"; fi
161226
162- - name : Install Windows packages (Windows MSVC)
227+ - name : Install Windows packages (MSVC)
163228 if : env.IS_WINDOWS_MSVC == 'true'
164229 shell : cmd
165230 run : choco install ninja
166231
167- - name : Set up VS Developer Command Prompt (Windows MSVC)
232+ - name : Set up VS Developer Command Prompt (MSVC)
168233 if : env.IS_WINDOWS_MSVC == 'true'
169234 uses : ilammy/msvc-dev-cmd@v1
170235 with :
171236 arch : ${{ matrix.arch }}
172237
173- - name : Install dependencies (Windows MSVC)
174- if : env.IS_WINDOWS_MSVC == 'true'
238+ - name : Build dependencies (MSVC)
239+ if : env.IS_WINDOWS_MSVC == 'true' && github.event.inputs.tools_windows_msvc_branch
175240 shell : cmd
241+ env :
242+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # used by scripts to prevent GitHub rate limit errors
176243 run : |
177244 mkdir %DEPS_PATH% & cd %DEPS_PATH%
178- git clone https://github.com/gnustep/tools-windows-msvc.git || exit /b 1
245+ git clone -q -b ${{github.event.inputs.tools_windows_msvc_branch}} https://github.com/gnustep/tools-windows-msvc.git || exit /b 1
179246 cd tools-windows-msvc
180247 :: use msys2.cmd from setup-msys2 as Bash shell, as it doesn't have msys2_shell.cmd used normally by build.bat
181248 set "BASH=msys2 -c"
182249 build.bat --prefix=%INSTALL_PATH% --type Release --only-dependencies
183250
184- - name : Set environment variables (Windows)
185- if : runner.os == 'Windows'
251+ - name : Install pre-built dependencies (MSVC)
252+ if : env.IS_WINDOWS_MSVC == 'true' && !github.event.inputs.tools_windows_msvc_branch
253+ shell : cmd
254+ run : |
255+ mkdir %INSTALL_PATH% & cd %INSTALL_PATH%
256+ # download latest pre-built release
257+ curl -L -o GNUstep-Windows-MSVC.zip https://github.com/gnustep/tools-windows-msvc/releases/download/latest/GNUstep-Windows-MSVC-${{matrix.arch}}.zip || exit /b 1
258+ # extract excluding debug build and GNUstep components (we need dependencies only)
259+ tar -xvf GNUstep-Windows-MSVC.zip --strip 1 --exclude Debug --exclude "**/gnustep*" --exclude "**/GNUstep*" --exclude Foundation --exclude CoreFoundation || exit /b 1
260+ del /Q GNUstep-Windows-MSVC.zip
261+
262+ - name : Set environment variables
186263 run : |
187264 # MSVC: update install path to include [x86|x64]/Release subdir used by build.bat above
188265 if [ "$IS_WINDOWS_MSVC" = "true" ]; then
@@ -193,8 +270,7 @@ jobs:
193270 echo "DEPS_PATH=`cygpath -u $DEPS_PATH`" >> $GITHUB_ENV
194271
195272 - name : Install dependencies
196- run : |
197- ./.github/scripts/dependencies.sh
273+ run : ./.github/scripts/dependencies.sh
198274
199275 - name : Build source
200276 run : |
@@ -216,7 +292,7 @@ jobs:
216292 make check
217293
218294 - name : Upload logs
219- uses : actions/upload-artifact@v2
295+ uses : actions/upload-artifact@v3
220296 if : always()
221297 with :
222298 name : Logs - ${{ matrix.name }}
0 commit comments