name: Linux CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-18.04

    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-haskell@v1

    - name: Install SDL dependency (for SDL tests)
      run: |
        sudo apt-get update && sudo apt-get install libsdl2-dev       \
                                                    libsdl2-gfx-dev   \
                                                    libsdl2-image-dev \
                                                    libsdl2-mixer-dev \
                                                    libsdl2-ttf-dev

    - uses: actions/cache@v1
      name: Cache ~/.stack
      with:
        path: ~/.stack
        key: ${{ runner.os }}-stack-${{ github.sha }}
        restore-keys: ${{ runner.os }}-stack-

    - name: Build
      run: stack build

    - name: Run Compiler Tests
      run: stack test

    - name: Run Carp Tests
      run: ./scripts/run_carp_tests.sh


name: Linux CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-18.04

    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-haskell@v1

    - name: Install SDL dependency (for SDL tests)
      run: |
        sudo apt-get update && sudo apt-get install libsdl2-dev       \
                                                    libsdl2-gfx-dev   \
                                                    libsdl2-image-dev \
                                                    libsdl2-mixer-dev \
                                                    libsdl2-ttf-dev

    - uses: actions/cache@v1
      name: Cache ~/.stack
      with:
        path: ~/.stack
        key: ${{ runner.os }}-stack-${{ github.sha }}
        restore-keys: ${{ runner.os }}-stack-

    - name: Build
      run: stack build

    - name: Run Compiler Tests
      run: stack test

    - name: Run Carp Tests
      run: ./scripts/run_carp_tests.sh

    - name: Copy Docs to carp-docs Repository
      uses: andstor/copycat-action@v3
      with:
        personal_token: ${{ secrets.PERSONAL_TOKEN }}
        src_path: /docs/core
        dst_path: /core
        dst_owner: carp-lang
        dst_repo_name: carp-docs

Copy docs to external repository
feat: Copy docs to external repository
