-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding github actions for CI Signed-off-by: Scott Nichols <[email protected]> * remove golang 1.14+ t.Cleanup call. Signed-off-by: Scott Nichols <[email protected]> * break apart the style tests Signed-off-by: Scott Nichols <[email protected]> * Adding integration tests with github services Signed-off-by: Scott Nichols <[email protected]> * adding linting exceptions Signed-off-by: Scott Nichols <[email protected]> * go mod tidy Signed-off-by: Scott Nichols <[email protected]> * add ADV_HOST Signed-off-by: Scott Nichols <[email protected]> * natss has bumped to 0.18 Signed-off-by: Scott Nichols <[email protected]> * run int test at 1.14 anf 1.15 go version Signed-off-by: Scott Nichols <[email protected]>
- Loading branch information
Scott Nichols
authored
Sep 28, 2020
1 parent
f0303ff
commit 68306c1
Showing
20 changed files
with
392 additions
and
357 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,36 @@ | ||
name: Conformance | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
conformance: | ||
name: CloudEvents | ||
strategy: | ||
matrix: | ||
go-version: [1.13.x, 1.14.x, 1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update git submodule | ||
run: git submodule sync && git submodule update --init | ||
|
||
- name: Build | ||
run: ./hack/conformance-test.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,33 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
go-version: [1.13.x, 1.14.x, 1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
run: ./hack/build-test.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,40 @@ | ||
name: Go Format | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Setup Go 1.14.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Go Format | ||
shell: bash | ||
run: | | ||
gofmt -s -w $(find -type f -name '*.go' -print) | ||
- name: Verify | ||
shell: bash | ||
run: | | ||
if [[ $(git diff-index --name-only HEAD --) ]]; then | ||
echo "Found diffs in:" | ||
git diff-index --name-only HEAD -- | ||
echo "${{ github.repository }} is out of style. Please run go fmt." | ||
exit 1 | ||
fi | ||
echo "${{ github.repository }} is formatted correctly." |
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,37 @@ | ||
name: Code Style | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Setup Go 1.14.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- id: golangci_configuration | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: .golangci.yaml | ||
|
||
- name: Go Lint on ./v2 | ||
if: steps.golangci_configuration.outputs.files_exists == 'true' | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.29 | ||
working-directory: v2 | ||
|
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,32 @@ | ||
name: Unit Test | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
test: | ||
name: Unit Test | ||
strategy: | ||
matrix: | ||
go-version: [1.13.x, 1.14.x, 1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: ./hack/unit-test.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,55 @@ | ||
name: Inclusive | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
language: | ||
name: Language | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# This is mostly copied from https://github.com/get-woke/woke-action-reviewdog/blob/main/entrypoint.sh | ||
# since their action is not yet released under a stable version. | ||
- name: Woke | ||
shell: bash | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | ||
WOKE_VERSION: v0.1.11 | ||
run: | | ||
set -e | ||
cd "${GITHUB_WORKSPACE}" || exit 1 | ||
TEMP_PATH="$(mktemp -d)" | ||
PATH="${TEMP_PATH}:$PATH" | ||
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' | ||
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" 2>&1 | ||
echo '::endgroup::' | ||
echo '::group:: Installing woke ... https://github.com/get-woke/woke' | ||
curl -sfL https://raw.githubusercontent.com/get-woke/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${WOKE_VERSION}" 2>&1 | ||
echo '::endgroup::' | ||
# Create a minimal .wokeignore if none already exist. | ||
if [ ! -f .wokeignore ]; then | ||
echo "vendor\nthird_party" > .wokeignore | ||
fi | ||
echo '::group:: Running woke with reviewdog 🐶 ...' | ||
woke --output simple \ | ||
| reviewdog -efm="%f:%l:%c: %m" \ | ||
-name="woke" \ | ||
-reporter="github-pr-check" \ | ||
-filter-mode="added" \ | ||
-fail-on-error="true" \ | ||
-level="error" \ | ||
echo '::endgroup::' |
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,70 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-*' ] | ||
pull_request: | ||
branches: [ 'master', 'release-*' ] | ||
|
||
jobs: | ||
|
||
integration: | ||
name: CloudEvents | ||
strategy: | ||
matrix: | ||
go-version: [1.14.x, 1.15.x] | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
services: | ||
kafka: | ||
image: lensesio/fast-data-dev | ||
env: | ||
ADV_HOST: localhost | ||
ports: | ||
- 9091:9091 | ||
- 9092:9092 | ||
|
||
natss: | ||
image: nats-streaming:0.18.0 | ||
ports: | ||
- 4222:4222 | ||
|
||
amqp: | ||
image: scholzj/qpid-dispatch | ||
env: | ||
QDROUTERD_CONFIG_OPTIONS: | | ||
router { | ||
mode: standalone | ||
id: ZTg2NDQ0N2Q1YjU1OGE1N2NkNzY4NDFk | ||
workerThreads: 4 | ||
} | ||
log { | ||
module: DEFAULT | ||
enable: trace+ | ||
timestamp: true | ||
} | ||
listener { | ||
role: normal | ||
host: 0.0.0.0 | ||
port: amqp | ||
saslMechanisms: ANONYMOUS | ||
} | ||
ports: | ||
- 5672:5672 | ||
|
||
steps: | ||
|
||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: ./hack/integration-test.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,12 @@ | ||
run: | ||
timeout: 5m | ||
|
||
build-tags: | ||
- conformance | ||
|
||
linters: | ||
enable: | ||
- unconvert | ||
- prealloc | ||
disable: | ||
- errcheck |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
for gomodule in $(find . | grep "go\.mod" | awk '{gsub(/\/go.mod/,""); print $0}' | grep -v "./test" | grep -v "./conformance") | ||
do | ||
echo | ||
echo --- Building $gomodule --- | ||
echo | ||
pushd $gomodule | ||
|
||
|
||
tags="$(grep -I -r '// +build' . | cut -f3 -d' ' | sort | uniq | grep -v '^!' | tr '\n' ' ')" | ||
|
||
echo "Building with tags: ${tags}" | ||
go test -vet=off -tags "${tags}" -run=^$ ./... | grep -v "no test" || true | ||
|
||
popd | ||
done |
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
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
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
Oops, something went wrong.