diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 33785926923..dc36ca73412 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -11,13 +11,17 @@ on: jobs: copilot-setup-steps: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} permissions: contents: read env: - PLATFORM: linux64 OCAML_VERSION: 5.3.0 OPAMYES: 1 + MINGW_ARCH: x86_64 + CYG_ROOT: C:\cygwin steps: - name: Checkout repository @@ -26,6 +30,7 @@ jobs: submodules: recursive - name: Install system dependencies + if: runner.os == 'Linux' run: | set -ex sudo apt-get update -qqy @@ -36,6 +41,7 @@ jobs: libuv1-dev libreadline-dev - name: Cache opam + if: runner.os == 'Linux' id: cache-opam uses: actions/cache@v4 with: @@ -43,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ runner.arch }}-5.3.0-${{ hashFiles('./haxe.opam', './libs/') }}-1 - name: Initialize opam and install OCaml 5.3.0 - if: steps.cache-opam.outputs.cache-hit != 'true' + if: runner.os == 'Linux' && steps.cache-opam.outputs.cache-hit != 'true' run: | set -ex opam init -c 5.3.0 --no-setup @@ -53,6 +59,7 @@ jobs: ocamlopt -v - name: Persist opam environment for subsequent steps + if: runner.os == 'Linux' run: | set -ex eval $(opam env) @@ -61,17 +68,23 @@ jobs: echo "CAML_LD_LIBRARY_PATH=$CAML_LD_LIBRARY_PATH" >> $GITHUB_ENV echo "OCAML_TOPLEVEL_PATH=$OCAML_TOPLEVEL_PATH" >> $GITHUB_ENV + - name: Setup OCaml (Windows) + if: runner.os == 'Windows' + uses: ./.github/actions/setup-ocaml-windows + - name: Setup Neko uses: ./.github/actions/setup-neko env: - PLATFORM: linux64 + PLATFORM: ${{ runner.os == 'Linux' && 'linux64' || 'windows64' }} - name: Make Neko shared libraries available to the dynamic linker + if: runner.os == 'Linux' run: | echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf sudo ldconfig - - name: Build Haxe + - name: Build Haxe (Linux) + if: runner.os == 'Linux' run: | set -ex eval $(opam env) @@ -82,10 +95,22 @@ jobs: ldd -v ./haxe ldd -v ./haxelib + - name: Build Haxe (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + Set-PSDebug -Trace 1 + $PSNativeCommandUseErrorActionPreference = $true + $ErrorActionPreference = 'Stop' + opam exec -- make -s -f Makefile.win -j"$env:NUMBER_OF_PROCESSORS" haxe + opam exec -- make -s -f Makefile.win haxelib + - name: Add workspace to PATH + shell: bash run: echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - name: Setup haxelib + shell: bash run: | set -ex mkdir ~/haxelib