Skip to content

Commit 407dfb7

Browse files
authored
Merge pull request #26255 from dra27/update-gha
Windows CI tweaks
2 parents 7b61e39 + 914433c commit 407dfb7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/windows.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,39 @@ jobs:
1818
- name: Checkout tree
1919
uses: actions/checkout@v4
2020

21+
- name: Download install.ps1
22+
run: |
23+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
24+
(New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1", ".\install.ps1")
25+
2126
- name: Restore opam cache
2227
id: cache-opam
2328
uses: actions/cache/restore@v4
2429
with:
2530
path: |
2631
D:\opam\bin
2732
D:\opamroot
28-
key: ${{ runner.os }}-opam
33+
key: ${{ runner.os }}-opam-${{ hashFiles('install.ps1') }}
2934

3035
- name: Install opam
3136
if: steps.cache-opam.outputs.cache-hit != 'true'
3237
run: |
33-
Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/kit-ty-kate/opam/windows-installer.debug/shell/install.ps1) } -OpamBinDir 'D:\opam\bin' -NoSetPath -NoAdmin"
38+
Invoke-Expression "& ./install.ps1 -OpamBinDir 'D:\opam\bin'"
3439
3540
- name: Add opam to PATH
3641
run: |
42+
D:\opam\bin\opam --version
3743
"D:\opam\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
3844
3945
- name: Init opam
4046
if: steps.cache-opam.outputs.cache-hit != 'true'
4147
run: opam init --yes --no-setup .
4248

49+
- name: Restrict testing to available compilers
50+
if: steps.cache-opam.outputs.cache-hit != 'true'
51+
# TODO Amend this lowerbound as older compiler packages are updated
52+
run: opam switch set-invariant --formula "`"ocaml`" {>= `"4.13`"}"
53+
4354
- name: Save opam cache
4455
if: steps.cache-opam.outputs.cache-hit != 'true'
4556
uses: actions/cache/save@v4

0 commit comments

Comments
 (0)