# This file is auto-generated
#
# To regenerate it run
#
#     make github-actions
#
name: Bootstrap
on:
  push:
    branches:
      - master
      - "3.4"
  pull_request:
    branches:
      - master
      - "3.4"
  release:
    types:
      - created

jobs:
  boostrap-linux:
    name: Bootstrap on Linux
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - name: bootstrap.py
        run: |
          ghcup install ghc 8.10.4
          python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.4) -d bootstrap/linux-8.10.4.json

      - name: Smoke test
        run: |
          _build/bin/cabal --version

      - uses: actions/upload-artifact@v2
        with:
          name: cabal-linux-bootstrapped
          path: _build/artifacts/*

  boostrap-macos:
    name: Bootstrap on macOS
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2

      # We use linux dependencies
      - name: bootstrap.py
        run: |
          ghcup install ghc 8.10.4
          python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.4) -d bootstrap/linux-8.10.4.json

      - name: Smoke test
        run: |
          _build/bin/cabal --version

      - uses: actions/upload-artifact@v2
        with:
          name: cabal-macos-bootstrapped
          path: _build/artifacts/*
