Skip to content

Commit

Permalink
[ci] Run windows make commands natively
Browse files Browse the repository at this point in the history
With native opam, we no longer need to build from the cygwin bash.

This means we can rely on native git.
  • Loading branch information
tobil4sk committed Dec 12, 2024
1 parent 264a004 commit 66576db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 42 deletions.
30 changes: 9 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ jobs:
opam install haxe --deps-only
opam list
# required to be able to retrieve the revision
- name: Mark directory as safe
shell: pwsh
run: |
Set-PSDebug -Trace 1
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"')
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: pwsh
Expand All @@ -85,20 +78,15 @@ jobs:
shell: pwsh
run: |
Set-PSDebug -Trace 1
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco 2>&1')
dir out
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
- name: Check artifact
shell: bash
run: |
ls out
# Output should contain binaries zip, installer zip and nupkg
[ $(ls -1 out | wc -l) -eq "3" ]
# stop after any command returns an error
$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
opam exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco
cygcheck ./haxe.exe
cygcheck ./haxelib.exe
ls ./out
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
30 changes: 9 additions & 21 deletions extra/github-actions/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# required to be able to retrieve the revision
- name: Mark directory as safe
shell: pwsh
run: |
Set-PSDebug -Trace 1
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"')
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: pwsh
Expand All @@ -14,20 +7,15 @@
shell: pwsh
run: |
Set-PSDebug -Trace 1
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco 2>&1')
dir out
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
- name: Check artifact
shell: bash
run: |
ls out
# Output should contain binaries zip, installer zip and nupkg
[ $(ls -1 out | wc -l) -eq "3" ]
# stop after any command returns an error
$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
opam exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco
cygcheck ./haxe.exe
cygcheck ./haxelib.exe
ls ./out
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 66576db

Please sign in to comment.