summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
authorBe <be@mixxx.org>2021-09-08 10:12:59 -0500
committerBe <be@mixxx.org>2021-09-08 10:13:51 -0500
commite32cedfe0014c1a37158aa0dee5139c91614358d (patch)
treeef45cd0cec026e993f0bfbdcd1c92511d4c3a89e /.github/workflows/build.yml
parent3568473d06da1ac6176e7091103ad1ca3be592b5 (diff)
GH Actions: fix Windows caching
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml60
1 files changed, 31 insertions, 29 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0343411664..22158e8c60 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -116,35 +116,6 @@ jobs:
artifact-windows-win64: ${{ steps.prepare_deploy.outputs.artifact-windows-win64 }}
steps:
- - name: "[Windows] Install rsync and openssh"
- if: runner.os == 'Windows'
- run: |
- $Env:PATH="c:\msys64\usr\bin;$Env:PATH"
- pacman -S --noconfirm coreutils bash rsync openssh
- # Unfortunately, mixing executables from msys64 and mingw (i.e. Git
- # Bash) does not work properly and leads to errors like these:
- #
- # 0 [main] python3 (5248) C:\msys64\usr\bin\python3.exe: *** fatal error - cygheap base mismatch detected - 0x180347408/0x180352408.
- #
- # Even when prepending the MSYS2 binary directory to %PATH%, GitHub
- # Actions will still pick the Git Bash executable over the MSYS2 one
- # when using `shell: bash`. Since it's not feasible to set `shell` to
- # an absolute path in a cross-platform build workflow, we overwrite the
- # git bash executable with the MSYS2 one.
- #
- # Also see related issue:
- # https://github.com/actions/virtual-environments/issues/594
- Copy-Item -Path "C:\msys64\usr\bin\bash.exe" -Destination "C:\Program Files\Git\bin\bash.exe" -Force
- # By default, MSYS2 uses an
- # /etc/profile file that changes
- # the current working directory
- # when bash is started. We don't
- # want this behavior,so we just
- # delete it.
- Remove-Item -Path "C:\msys64\etc\profile"
- # Add MSYS2's tools to %PATH%.
- Add-Content -Path "$Env:GITHUB_ENV" -Value "PATH=$Env:PATH"
-
# sccache's handling of the /fp:fast MSVC compiler option is broken, so use our fork with the fix.
# https://github.com/mozilla/sccache/issues/950
- name: "[Windows] Set up cargo cache"
@@ -384,6 +355,37 @@ jobs:
--dest-url 'https://downloads.mixxx.org'
${{ matrix.artifacts_path }}
+ # Warning: do not move this step before restoring caches or it will break caching due to
+ # https://github.com/actions/cache/issues/531
+ - name: "[Windows] Install rsync and openssh"
+ if: runner.os == 'Windows'
+ run: |
+ $Env:PATH="c:\msys64\usr\bin;$Env:PATH"
+ pacman -S --noconfirm coreutils bash rsync openssh
+ # Unfortunately, mixing executables from msys64 and mingw (i.e. Git
+ # Bash) does not work properly and leads to errors like these:
+ #
+ # 0 [main] python3 (5248) C:\msys64\usr\bin\python3.exe: *** fatal error - cygheap base mismatch detected - 0x180347408/0x180352408.
+ #
+ # Even when prepending the MSYS2 binary directory to %PATH%, GitHub
+ # Actions will still pick the Git Bash executable over the MSYS2 one
+ # when using `shell: bash`. Since it's not feasible to set `shell` to
+ # an absolute path in a cross-platform build workflow, we overwrite the
+ # git bash executable with the MSYS2 one.
+ #
+ # Also see related issue:
+ # https://github.com/actions/virtual-environments/issues/594
+ Copy-Item -Path "C:\msys64\usr\bin\bash.exe" -Destination "C:\Program Files\Git\bin\bash.exe" -Force
+ # By default, MSYS2 uses an
+ # /etc/profile file that changes
+ # the current working directory
+ # when bash is started. We don't
+ # want this behavior,so we just
+ # delete it.
+ Remove-Item -Path "C:\msys64\etc\profile"
+ # Add MSYS2's tools to %PATH%.
+ Add-Content -Path "$Env:GITHUB_ENV" -Value "PATH=$Env:PATH"
+
- name: "Set up SSH Agent"
if: github.event_name == 'push' && env.SSH_PRIVATE_KEY != null
shell: bash