name: Nightly Tests

on:
  schedule:
    - cron:  '0 3 * * *'
  workflow_dispatch:

env:
  GOPROXY: https://proxy.golang.org/

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    strategy:
      fail-fast: false
    steps:
      -
        name: Checkout
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # https://github.com/actions/checkout/releases/tag/v4.1.1
      -
        name: Unshallow
        run: git fetch --prune --unshallow
      -
        name: Set up Go
        uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # https://github.com/actions/setup-go/releases/tag/v4.1.0
        with:
          go-version-file: ".go-version"
      -
        name: Go mod download
        run: go mod download -x
      -
        name: Run long tests
        run: go test -timeout=30m -tags=longtest ./...
