Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate multiple collections #73

Merged
merged 10 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
raulb marked this conversation as resolved.
Show resolved Hide resolved

# 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ specified time, and then repeating the same cycle. The connector always start wi

### Configuration

// TODO update this section
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the readme shortly (probably tomorrow).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be super, thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raulb @hariso can you take one more look at the readme if you get a chance? 🙏


#### recordCount
Number of records to be generated. -1 for no limit.
* Required: false
Expand Down
Loading