name: Project build

on: push

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - name: Install
        run: sudo apt-get update && sudo apt-get install -y build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libcloog-isl-dev libisl-0.18-dev ccache curl nasm grub-common qemu qemu-kvm mtools cmake
      - name: Get cross compiler
        id: cache-cross
        uses: actions/cache@v1
        with:
          path: cross
          key: toller-compiler
      - name: Build cross compiler
        if: steps.cache-cross.outputs.cache-hit != 'true'
        run: sh run cross
      - name: Build
        run: sh run build -y
      - name: Test install
        run: sh run image