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,11 @@ 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_MINGW : ${{ startsWith(matrix.msystem, 'MINGW') }}
169+ IS_WINDOWS_MSVC : ${{ endsWith(matrix.host, '-pc-windows') }}
82170 CC : ${{ matrix.CC }}
83171 CXX : ${{ matrix.CXX }}
84172 LDFLAGS : ${{ matrix.LDFLAGS }}
@@ -93,37 +181,15 @@ jobs:
93181
94182 defaults :
95183 run :
96- shell : ${{ startsWith(matrix.os, 'windows') && ' msys2 {0}' || 'bash' } }
184+ shell : msys2 {0}
97185 working-directory : ${{ env.SRC_PATH }}
98186
99187 steps :
100- - uses : actions/checkout@v2
188+ - uses : actions/checkout@v3
101189 with :
102190 path : ${{ env.SRC_PATH }}
103191
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)
192+ - name : Set up MSYS2 (MinGW)
127193 uses : msys2/setup-msys2@v2
128194 if : env.IS_WINDOWS_MINGW == 'true'
129195 with :
@@ -145,7 +211,7 @@ jobs:
145211 mingw-w64-${{matrix.arch}}-gnutls
146212 mingw-w64-${{matrix.arch}}-icu
147213
148- - name : Set up MSYS2 (Windows MSVC)
214+ - name : Set up MSYS2 (MSVC)
149215 uses : msys2/setup-msys2@v2
150216 if : env.IS_WINDOWS_MSVC == 'true'
151217 with :
@@ -154,35 +220,47 @@ jobs:
154220 # make Windows packages like Clang available in MSYS
155221 path-type : inherit
156222
157- - name : Delete MinGW gmake (Windows MSVC)
223+ - name : Delete MinGW gmake (MSVC)
158224 if : env.IS_WINDOWS_MSVC == 'true'
159225 # delete /c/Strawberry/c/bin/gmake built for MinGW that is found on runners, because we must use make built for MSYS
160226 run : if GMAKE_PATH=`which gmake`; then rm -f "$GMAKE_PATH"; fi
161227
162- - name : Install Windows packages (Windows MSVC)
228+ - name : Install Windows packages (MSVC)
163229 if : env.IS_WINDOWS_MSVC == 'true'
164230 shell : cmd
165231 run : choco install ninja
166232
167- - name : Set up VS Developer Command Prompt (Windows MSVC)
233+ - name : Set up VS Developer Command Prompt (MSVC)
168234 if : env.IS_WINDOWS_MSVC == 'true'
169235 uses : ilammy/msvc-dev-cmd@v1
170236 with :
171237 arch : ${{ matrix.arch }}
172238
173- - name : Install dependencies (Windows MSVC)
174- if : env.IS_WINDOWS_MSVC == 'true'
239+ - name : Build dependencies (MSVC)
240+ if : env.IS_WINDOWS_MSVC == 'true' && github.event.inputs.tools_windows_msvc_branch
175241 shell : cmd
242+ env :
243+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # used by scripts to prevent GitHub rate limit errors
176244 run : |
177245 mkdir %DEPS_PATH% & cd %DEPS_PATH%
178- git clone https://github.com/gnustep/tools-windows-msvc.git || exit /b 1
246+ git clone -q -b ${{github.event.inputs.tools_windows_msvc_branch}} https://github.com/gnustep/tools-windows-msvc.git || exit /b 1
179247 cd tools-windows-msvc
180248 :: use msys2.cmd from setup-msys2 as Bash shell, as it doesn't have msys2_shell.cmd used normally by build.bat
181249 set "BASH=msys2 -c"
182250 build.bat --prefix=%INSTALL_PATH% --type Release --only-dependencies
183251
184- - name : Set environment variables (Windows)
185- if : runner.os == 'Windows'
252+ - name : Install pre-built dependencies (MSVC)
253+ if : env.IS_WINDOWS_MSVC == 'true' && !github.event.inputs.tools_windows_msvc_branch
254+ shell : cmd
255+ run : |
256+ mkdir %INSTALL_PATH% & cd %INSTALL_PATH%
257+ # download latest pre-built release
258+ 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
259+ # extract excluding debug build and GNUstep components (we need dependencies only)
260+ tar -xvf GNUstep-Windows-MSVC.zip --strip 1 --exclude Debug --exclude "**/gnustep*" --exclude "**/GNUstep*" --exclude Foundation --exclude CoreFoundation || exit /b 1
261+ del /Q GNUstep-Windows-MSVC.zip
262+
263+ - name : Set environment variables
186264 run : |
187265 # MSVC: update install path to include [x86|x64]/Release subdir used by build.bat above
188266 if [ "$IS_WINDOWS_MSVC" = "true" ]; then
@@ -193,8 +271,7 @@ jobs:
193271 echo "DEPS_PATH=`cygpath -u $DEPS_PATH`" >> $GITHUB_ENV
194272
195273 - name : Install dependencies
196- run : |
197- ./.github/scripts/dependencies.sh
274+ run : ./.github/scripts/dependencies.sh
198275
199276 - name : Build source
200277 run : |
@@ -216,7 +293,7 @@ jobs:
216293 make check
217294
218295 - name : Upload logs
219- uses : actions/upload-artifact@v2
296+ uses : actions/upload-artifact@v3
220297 if : always()
221298 with :
222299 name : Logs - ${{ matrix.name }}
0 commit comments