forked from open-telemetry/opentelemetry-log-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for testing contrib repo (open-telemetry#232)
* Add workflow for testing contrib repo Fixes open-telemetry#199 * Add changes suggested by @djaglowski in code review * Ignore top level module and add -compat to go mod tidy
- Loading branch information
1 parent
049d0cb
commit 85bc3f4
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
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 | ||
./check-contrib.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CURDIR=$(pwd) | ||
CONTRIB_PATH="/tmp/opentelemetry-collector-contrib" | ||
LOG_COLLECTION_MOD_NAME="github.com/open-telemetry/opentelemetry-log-collection" | ||
LOG_COLLECTION_MODULES=$(find ${CONTRIB_PATH} ! -path ${CONTRIB_PATH}/go.mod ! -path ${CONTRIB_PATH}/cmd/configschema/go.mod -type f -name "go.mod" -exec grep -l ${LOG_COLLECTION_MOD_NAME} {} \; | xargs -L 1 dirname | sort) | ||
echo "Log collection modules - ${LOG_COLLECTION_MODULES}" | ||
|
||
for module in ${LOG_COLLECTION_MODULES} | ||
do | ||
pushd ${module} | ||
go mod edit -replace github.com/open-telemetry/opentelemetry-log-collection=${CURDIR} | ||
rm -fr go.sum | ||
go mod tidy -compat=1.17 | ||
go test | ||
go mod edit -dropreplace github.com/open-telemetry/opentelemetry-log-collection | ||
popd | ||
done |