[new release] curses (1.0.12) #9626
Workflow file for this run
This file contains hidden or 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: | |
| permissions: read-all | |
| jobs: | |
| analyse: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.matrix.outputs.result }} | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47 | |
| - name: Compute build matrix | |
| id: matrix | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| let changed_files = '${{ steps.changed-files.outputs.all_changed_files }}'; | |
| let packages = []; | |
| for (file of changed_files.split(' ')) { | |
| console.log("Changed: " + file); | |
| const package = file.match(/^packages\/[^/]+\/([^/]+)/); | |
| if (package) | |
| packages.push(package[1]); | |
| } | |
| const splits = | |
| Array.from({ length: Math.ceil(packages.length / 75) }, | |
| (_, i) => packages.slice(i * 75, i * 75 + 75).join(' ')); | |
| return {windows_environment: ['cygwin', 'msys2'], packages: splits}; | |
| build: | |
| name: "target/host: x86_64-w64-mingw32, build: ${{ matrix.windows_environment }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.analyse.outputs.matrix) }} | |
| if: ${{ join(fromJSON(needs.analyse.outputs.matrix).packages) != '' }} | |
| runs-on: windows-latest | |
| needs: analyse | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v6 | |
| - name: Set-up OCaml | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: "5" | |
| opam-repositories: | | |
| default: git+file://${{ github.workspace }} | |
| opam-pin: false | |
| windows-environment: ${{ matrix.windows_environment }} | |
| - name: Install packages | |
| run: | | |
| $failed = $false | |
| Foreach ($pkg in '${{ matrix.packages }}' -split ' ') { | |
| Write-Host "::group::Testing `e[1;34m$pkg`e[0m" | |
| opam install --color=always --confirm-level=unsafe-yes "$pkg" | |
| Write-Host "::endgroup::" | |
| switch ($LASTEXITCODE) { | |
| 0 { Write-Host "`e[1;32m$pkg installed successfully`e[0m."; Break } | |
| 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 | |
| 20 { Write-Host "$pkg is not installable. `e[1;33mSkip`e[0m."; Break } | |
| 31 { Write-Host "`e[1;31m$pkg failed to build`e[0m."; $failed = $true; Break } | |
| default { throw "Unexpected error $_" } | |
| } | |
| Write-Host | |
| } | |
| if ($failed) { | |
| throw "One or more packages failed to build" | |
| } | |
| Exit |