name: check

on:
  pull_request:
    paths-ignore:
      - 'Firestore/**'
  push:
    branches: master

jobs:
  check:
    runs-on: macos-latest
    env:
      MINT_PATH: ${{ github.workspace }}/mint
    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-python@v2
      with:
        python-version: 3.6

    - name: Cache Mint packages
      uses: actions/cache@v1
      with:
        path: ${{ env.MINT_PATH }}
        key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
        restore-keys: ${{ runner.os }}-mint-

    - name: Setup check
      run:  scripts/setup_check.sh

    - name: Check
      run:  scripts/check.sh --test-only
