name: Builder - Integration tests

on:
  # on changes to the main branch touching the builder
  push:
    branches: [ main ]
    paths:
      - 'cmd/builder/**'

  # on PRs touching the builder
  pull_request:
    branches: [ main ]
    paths:
      - 'cmd/builder/**'
  
  # once a day at 6:17 AM UTC
  schedule:
    - cron: '17 6 * * *'

  # manual execution
  workflow_dispatch:

jobs:
  integration-test:
    name: Integration test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3
      - name: Setup Go
        uses: actions/setup-go@v3
        with:
          go-version: 1.17
      - name: Test
        run: cd ./cmd/builder && ./test/test.sh
