name: contrib-tests on: push: branches: [main] tags: - v[0-9]+.[0-9]+.[0-9]+.* pull_request: types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled] branches: [main] merge_group: types: [checks_requested] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true permissions: read-all jobs: contrib-tests-prepare: runs-on: ubuntu-latest if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Contrib Tests') }} steps: - name: Checkout Repo uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - name: Prepare Contrib Tests run: | contrib_path=/tmp/opentelemetry-collector-contrib git clone --depth=1 https://github.com/open-telemetry/opentelemetry-collector-contrib.git $contrib_path make CONTRIB_PATH=$contrib_path prepare-contrib - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: contrib path: /tmp/opentelemetry-collector-contrib/ include-hidden-files: true contrib-tests-matrix: runs-on: ubuntu-latest needs: [contrib-tests-prepare] if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Contrib Tests') }} strategy: fail-fast: false matrix: group: - receiver-0 - receiver-1 - receiver-2 - receiver-3 - processor - exporter-0 - exporter-1 - extension - connector - internal - pkg - cmd-0 - other steps: - name: Checkout Repo uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - name: Download contrib uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 with: name: contrib path: /tmp/contrib - name: Setup Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 with: go-version: oldstable cache: false - name: Cache Go id: go-cache uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | ~/go/bin ~/go/pkg/mod key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }} - name: Run tests run: | chmod +x /tmp/contrib/.tools/* make CONTRIB_PATH=/tmp/contrib SKIP_RESTORE_CONTRIB=true GROUP=${{ matrix.group }} check-contrib contrib_tests: runs-on: ubuntu-latest if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Contrib Tests') }} needs: [contrib-tests-matrix] steps: - name: Print result run: echo ${{ needs.contrib-tests-matrix.result }} - name: Interpret result run: | if [[ success == ${{ needs.contrib-tests-matrix.result }} ]] then echo "All matrix jobs passed!" else echo "One or more matrix jobs failed." false fi