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-20.04
    steps:

    - name: Set up Go
      uses: actions/setup-go@v2.2.0
      with:
        go-version: 1.17

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Test
      run: cd ./cmd/builder && ./test/test.sh
