Skip to content

Commit

Permalink
Fix Windows GitHub Action
Browse files Browse the repository at this point in the history
- msys2 should be installed
- there is cabal and GHC, but we want to be sure about
  versions, so we reinstall.
- Reinstalling GHC doesnt' "just work", so we uninstall it first.
  This takes time, but makes CI work.
  • Loading branch information
phadej committed May 22, 2020
1 parent 120e539 commit bf66f07
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ jobs:
name: Artifact on Windows
runs-on: windows-latest
steps:
- name: Configure Chocolatey
run: choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- name: Install msys2
run: choco install -y msys2
- name: Install Cabal
run: choco install -y cabal --version 3.0.0.0
run: choco install -fy cabal --version 3.0.0.0
- name: Install GHC
run: choco install -y ghc --version 8.6.5
run: |
choco uninstall -y ghc
choco install -y ghc --version 8.6.5
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ jobs:
name: test ghc-8.6.5
runs-on: windows-latest
steps:
- name: Configure Chocolatey
run: choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- name: Install msys2
run: choco install -y msys2
- name: Install Cabal
run: choco install -y cabal --version 3.0.0.0
run: choco install -fy cabal --version 3.2.0.0
- name: Install GHC
run: choco install -y ghc --version 8.6.5
run: |
choco uninstall -y ghc --all-versions
choco install -y ghc --version 8.6.5
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\cabal\tools\cabal-3.0.0.0"
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.6.5\bin"
Write-Host "::add-path::C:\ProgramData\Chocolatey\lib\cabal\tools\cabal-3.2.0.0"
Write-Host "::add-path::C:\ProgramData\Chocolatey\lib\ghc\tools\ghc-8.6.5\bin"
[Environment]::GetEnvironmentVariable("Path")
- name: Print versions
run: |
ghc --version
[Environment]::GetEnvironmentVariable("Path")
cabal --version
ghc --version
cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3
- uses: actions/cache@v1
with:
path: C:\SR
key: linux-store-meta
key: windows-store-meta
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v2
Expand Down
10 changes: 4 additions & 6 deletions boot/ci-artifacts.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ jobs:
name: Artifact on Windows
runs-on: windows-latest
steps:
- name: Configure Chocolatey
run: choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- name: Install msys2
run: choco install -y msys2
- name: Install Cabal
run: choco install -y cabal --version 3.0.0.0
run: choco install -fy cabal --version 3.0.0.0
- name: Install GHC
run: choco install -y ghc --version 8.6.5
run: |
choco uninstall -y ghc
choco install -y ghc --version 8.6.5
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Expand Down
20 changes: 10 additions & 10 deletions boot/ci-windows.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ jobs:
needs: test-windows-{{ mangleVersion needs }}
{% endfor %}
steps:
- name: Configure Chocolatey
run: choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- name: Install msys2
run: choco install -y msys2
- name: Install Cabal
run: choco install -y cabal --version 3.0.0.0
run: choco install -fy cabal --version 3.2.0.0
- name: Install GHC
run: choco install -y ghc --version {{ job.version }}
run: |
choco uninstall -y ghc --all-versions
choco install -y ghc --version {{ job.version }}
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\cabal\tools\cabal-3.0.0.0"
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\ghc\tools\ghc-{{ job.version }}\bin"
Write-Host "::add-path::C:\ProgramData\Chocolatey\lib\cabal\tools\cabal-3.2.0.0"
Write-Host "::add-path::C:\ProgramData\Chocolatey\lib\ghc\tools\ghc-{{ job.version }}\bin"
[Environment]::GetEnvironmentVariable("Path")
- name: Print versions
run: |
ghc --version
[Environment]::GetEnvironmentVariable("Path")
cabal --version
ghc --version
cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3
- uses: actions/cache@v1
with:
path: C:\SR
key: linux-store-meta
key: windows-store-meta
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v2
Expand Down

0 comments on commit bf66f07

Please sign in to comment.