Skip to content

GitHub actions windows #6494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# https://github.community/t5/GitHub-Actions/git-config-core-autocrlf-should-default-to-false/m-p/30731#M534
* -text

/Cabal/ChangeLog.md merge=union
/cabal-install/changelog merge=union
/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/script.hs eol=crlf
138 changes: 138 additions & 0 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Artifacts
on:
push:
branches:
- master
- "3.2"
pull_request:
branches:
- master
release:
types:
- created

jobs:
artifact-linux:
name: Artifact on Linux
runs-on: ubuntu-18.04
container:
# Older Ubuntu for older glibc
image: phadej/ghc:8.6.5-xenial
steps:
- name: Set PATH
run: |
echo "::add-path::$HOME/.cabal/bin"
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v1
- name: Release project
run: |
cp cabal.project.release cabal.project
rm -rf cabal.project.local cabal.project.freeze
- name: Build
run: |
cabal v2-build cabal-install:exe:cabal
cp $(find dist-newstyle -type f -executable -name cabal) cabal.exe
- name: Smoke test
run: |
./cabal.exe --version
- name: Prepare for upload
run: xz -c < cabal.exe > cabal-artifact.xz
- uses: actions/upload-artifact@v1
with:
name: cabal-linux-x86_64.xz
path: cabal-artifact.xz

artifact-macos:
name: Artifact on macOS
runs-on: macos-latest
steps:
- name: Install GHC
run: |
cd $(mktemp -d)
curl -sLO "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz"
tar -xJf ghc-*.tar.xz
cd ghc-*
./configure --prefix=/opt/ghc/8.6.5
sudo make install
- name: Install Cabal
run: |
cd $(mktemp -d)
curl -sLO https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz
tar -xJf cabal-install-*.tar.xz
sudo mkdir -p /opt/cabal/3.0/bin
sudo cp cabal /opt/cabal/3.0/bin/cabal
sudo chmod 755 /opt/cabal/3.0/bin/cabal
- name: Set PATH
run: |
echo "::add-path::/opt/ghc/8.6.5/bin"
echo "::add-path::/opt/cabal/3.0/bin"
echo "::add-path::$HOME/.cabal/bin"
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v1
- name: Release project
run: |
cp cabal.project.release cabal.project
rm -rf cabal.project.local cabal.project.freeze
- name: Build
run: |
cabal v2-build cabal-install:exe:cabal
# macOS find doesn't know -executable
cp $(find dist-newstyle -type f -name cabal) cabal.exe
- name: Smoke test
run: |
./cabal.exe --version
- name: Prepare for upload
run: xz -c < cabal.exe > cabal-artifact.xz
- uses: actions/upload-artifact@v1
with:
name: cabal-macos-x86_64.xz
path: cabal-artifact.xz

artifact-windows:
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
- name: Install GHC
run: 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"
- name: Print versions
run: |
ghc --version
cabal --version
cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v1
- name: Release project
shell: bash
run: |
cp cabal.project.release cabal.project
rm -rf cabal.project.local cabal.project.freeze
- name: Build
shell: bash
run: |
cabal v2-build cabal-install:exe:cabal
cp dist-newstyle/build/x86_64-windows/ghc-8.6.5/cabal-install-3.3.0.0/build/cabal/cabal.exe cabal.exe
- name: Smoke test
shell: bash
run: |
./cabal.exe --version
- name: Prepare for upload
shell: bash
run: xz -c < cabal.exe > cabal-artifact.xz
- uses: actions/upload-artifact@v1
with:
name: cabal-windows-x86_64.xz
path: cabal-artifact.xz
64 changes: 64 additions & 0 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This file is auto-generated
#
# To regenerate it run
#
# make github-actions
#
name: Bootstrap
on:
push:
branches:
- master
- "3.2"
pull_request:
branches:
- master
release:
types:
- created

jobs:
boostrap-linux:
name: Bootstrap on Linux
runs-on: ubuntu-18.04
steps:
- name: Set PATH
run: |
echo "::add-path::/opt/ghc/8.6.5/bin"
- uses: actions/checkout@v1
- name: bootstrap.sh
env:
EXTRA_CONFIGURE_OPTS: ""
run: |
cd cabal-install
sh ./bootstrap.sh --no-doc
- name: Smoke test
run: |
$HOME/.cabal/bin/cabal --version

boostrap-macos:
name: Bootstrap on macOS
runs-on: macos-latest
steps:
- name: Install GHC
run: |
cd $(mktemp -d)
curl -sLO "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz"
tar -xJf ghc-*.tar.xz
cd ghc-*
./configure --prefix=/opt/ghc/8.6.5
sudo make install
- name: Set PATH
run: |
echo "::add-path::/opt/ghc/8.6.5/bin"
echo "::add-path::$HOME/.cabal/bin"
- uses: actions/checkout@v1
- name: bootstrap.sh
env:
EXTRA_CONFIGURE_OPTS: ""
run: |
cd cabal-install
sh ./bootstrap.sh --no-doc
- name: Smoke test
run: |
$HOME/.cabal/bin/cabal --version
Loading