Skip to content

Commit

Permalink
Generate multiple collections (#73)
Browse files Browse the repository at this point in the history
* [wip] add support for multiple collections

* tie generators in the source connector

* fix rawdata test

* rate limit test

* generate time as nanoseconds timestamp

* update connector SDK

* small fixes

* rename config parameters

* update readme

* move note about collections parameters
  • Loading branch information
lovromazgon authored Apr 24, 2024
1 parent c731ead commit 5e16fd4
Show file tree
Hide file tree
Showing 20 changed files with 238,130 additions and 862 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: 'go.mod'

# This step sets up the variable steps.golangci-lint-version.outputs.v
# to contain the version of golangci-lint (e.g. v1.54.2).
# The version is taken from go.mod.
- name: Golangci-lint version
id: golangci-lint-version
run: |
GOLANGCI_LINT_VERSION=$( go list -m -f '{{.Version}}' github.com/golangci/golangci-lint )
echo "v=$GOLANGCI_LINT_VERSION" >> "$GITHUB_OUTPUT"
- name: golangci-lint
uses: golangci/golangci-lint-action@v4.0.0
uses: golangci/golangci-lint-action@v4
with:
version: v1.51.2
version: ${{ steps.golangci-lint-version.outputs.v }}
skip-pkg-cache: true
args: --timeout=2m
6 changes: 3 additions & 3 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: build
name: test

on:
push:
branches: [ main ]
pull_request:

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: 'go.mod'

- name: Test
run: make test GOTEST_FLAGS="-v -count=1"
23 changes: 23 additions & 0 deletions .github/workflows/validate-generated-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: validate-generated-files

on:
push:
branches: [ main ]
pull_request:

jobs:
validate-generated-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Check generated files
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make install-tools generate
git diff --exit-code --numstat
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ linters-settings:
min-complexity: 20
goconst:
ignore-tests: true
gosec:
excludes:
- G404 # Insecure random number source (rand) - we use math/rand as we don't care about security in this context
goheader:
template-path: '.golangci.goheader.template'
values:
Expand Down
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
.PHONY: build test

VERSION=$(shell git describe --tags --dirty --always)

.PHONY: build
build:
go build -ldflags "-X 'github.com/conduitio/conduit-connector-generator.version=${VERSION}'" -o conduit-connector-generator cmd/connector/main.go

.PHONY: test
test:
go test $(GOTEST_FLAGS) -race ./...

.PHONY: lint
lint:
golangci-lint run

.PHONY: generate
generate:
go generate ./...

.PHONY: install-tools
install-tools:
@echo Installing tools from tools.go
@go list -e -f '{{ join .Imports "\n" }}' tools.go | xargs -I % go list -f "%@{{.Module.Version}}" % | xargs -tI % go install %
@go mod tidy
Loading

0 comments on commit 5e16fd4

Please sign in to comment.