# This file is auto-generated
#
# To regenerate it run
#
#     make github-actions
#
name: Bootstrap
on:
  push:
    branches:
      - master
      - "3.2"
  pull_request:
    branches:
      - master
      - "3.2"
  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@v2
      - 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@v2
      - 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
