---
name: Upgrade

on:
  pull_request:

jobs:
  upgrade-e2e:
    name: Latest Release to Latest Version
    timeout-minutes: 30
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
      - uses: actions/checkout@master

      - name: Reclaim free space
        run: |
          # cleanup 30GB+ of tools we don't need for our CI
          rm -rf /opt/ghc /usr/share/dotnet /usr/share/swift
          df -h
          free -h

      - name: Install an old cluster, upgrade it and check it
        run: |
          make upgrade-e2e

      - name: Post Mortem
        if: failure()
        run: |
          df -h
          free -h
          make post-mortem
