1010jobs :
1111 build :
1212 strategy :
13+ fail-fast : false
1314 matrix :
1415 os :
1516 - windows-latest
17+ windows_env :
18+ - cygwin
19+ - msys2
1620 runs-on : ${{ matrix.os }}
1721 steps :
1822 - name : Checkout tree
3236 path : |
3337 D:\opam\bin
3438 D:\opamroot
35- key : ${{ runner.os }}-opam-${{ hashFiles('install.ps1') }}
39+ key : ${{ runner.os }}-${{ matrix.windows_env }}-opam-${{ hashFiles('install.ps1') }}
40+
41+ - name : Add MSys2 to PATH and install prerequisites
42+ if : matrix.windows_env == 'msys2'
43+ run : |
44+ "C:\msys64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
45+ C:\msys64\usr\bin\pacman.exe --noconfirm -Syuu # Core update (in case any core packages are outdated)
46+ C:\msys64\usr\bin\pacman.exe --noconfirm -Syuu m4 make mingw-w64-i686-gcc mingw-w64-x86_64-gcc rsync unzip
3647
3748 - name : Install opam
3849 if : steps.cache-opam.outputs.cache-hit != 'true'
4657
4758 - name : Init opam
4859 if : steps.cache-opam.outputs.cache-hit != 'true'
49- run : opam init --yes --no-setup .
60+ run : opam init --yes --no-setup ${{ matrix.windows_env == 'msys2' && '--cygwin-local-install' || '' }} .
5061
5162 - name : Restrict testing to available compilers
5263 if : steps.cache-opam.outputs.cache-hit != 'true'
@@ -103,7 +114,7 @@ jobs:
103114 opam install --color=always --confirm-level=unsafe-yes "$pkg"
104115 Write-Host "::endgroup::"
105116 switch ($LASTEXITCODE) {
106- 0 { Break }
117+ 0 { Write-Host "`e[1;32m$pkg installed successfully`e[0m."; Break }
107118 5 { Write-Host "$pkg is not installable. `e[1;33mSkip`e[0m."; Break } # TODO: Remove when https://github.com/ocaml/opam/issues/6017 is fixed
108119 20 { Write-Host "$pkg is not installable. `e[1;33mSkip`e[0m."; Break }
109120 31 { Write-Host "`e[1;31m$pkg failed to build`e[0m."; $failed = $true; Break }
@@ -112,6 +123,6 @@ jobs:
112123 Write-Host
113124 }
114125 if ($failed) {
115- throw "build failed"
126+ throw "One or more packages failed to build "
116127 }
117128 Exit
0 commit comments