diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 00000000..d7a5ba7e --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,62 @@ +name: Haskell CI + +on: + # Trigger the workflow on push or pull request, + # but only for the master branch + push: + branches: + - master + pull_request: + +jobs: + build: + name: ghc ${{ matrix.ghc }} + runs-on: ubuntu-16.04 + strategy: + matrix: + ghc: ["8.8.1"] + cabal: ["3.0"] + + steps: + - uses: actions/checkout@v2 + if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' + + - uses: actions/setup-haskell@v1 + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + # We cache the elements of the Cabal store separately, + # as the entirety of ~/.cabal can grow very large + # for projects with many dependencies. + + - uses: actions/cache@v1 + name: Cache ~/.cabal/packages + with: + path: ~/.cabal/packages + key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-packages + - uses: actions/cache@v1 + name: Cache ~/.cabal/store + with: + path: ~/.cabal/store + key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-store + - uses: actions/cache@v1 + name: Cache dist-newstyle + with: + path: dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-dist-newstyle + + - name: Install sdl2 + run: | + sudo apt-get install libsdl2-dev + + - name: Install dependencies + run: | + cabal v2-update + cabal v2-configure --enable-tests --enable-documentation --write-ghc-environment-files=always + cabal v2-build --only-dependencies + - name: Build & test + run: | + cabal v2-build + echo 'No tests'