test #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows CI | |
on: | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout tree | |
uses: actions/checkout@v4 | |
- name: Install opam | |
run: | | |
Set-PSDebug -Trace 2 | |
Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/kit-ty-kate/opam/windows-installer.debug/shell/install.ps1) } -OpamBinDir 'C:\Program Files\opam\bin'" | |
"C:\Program Files\opam\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Init opam | |
run: opam init --debug-level=3 --kind git -yn ./opam-repository | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
#with: | |
# since_last_remote_commit: true | |
- name: List all changed packages | |
id: changed-packages | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
output = @() | |
Foreach ($file in $env:ALL_CHANGED_FILES) { | |
switch -Regex ($file) { | |
'^packages/[^/]*/([^/]*)/.*' { ouptput += "$($matches[1])"; Break } | |
default { echo "$file skipped"; Break } | |
} | |
done | |
$outputJson = $output | ConvertTo-Json | |
echo "::set-output name=data::$outputJson" | |
- name: Install packages | |
env: | |
ALL_CHANGED_PACKAGES: ${{ steps.changed-packages.outputs.data }} | |
run: | | |
pkgs = ${ALL_CHANGED_PACKAGES} | ConvertFrom-Json | |
Foreach ($pkg in $pkgs) { | |
opam install --confirm-level=unsafe-yes "$pkg" | |
} |