name: contrib-tests
on:
  push:
    branches: [ main ]
    tags:
      - v[0-9]+.[0-9]+.[0-9]+.*
  pull_request:

jobs:
  contrib_tests:
    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: Run Contrib Tests
        run: |
          contrib_path=/tmp/opentelemetry-collector-contrib
          git clone https://github.com/open-telemetry/opentelemetry-collector-contrib.git $contrib_path
          make CONTRIB_PATH=$contrib_path check-contrib
