name: tests

on:
  pull_request:
    paths-ignore:
      - '*.md'
  schedule:
    - cron:  0 23 * * *

jobs:
  build:
    name: building tfsec
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ macos-latest, windows-latest, ubuntu-latest ]

    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-go@v2
      with:
        go-version: '1.17'
    - run: go version
    - uses: actions/cache@v3
      with:
        path: |
          ~/.cache/go-build
          ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-go-

    - name: Run tests
      run: make test

