Skip to content

Commit 00aad4c

Browse files
committed
add github actions, tools
1 parent 3c7e886 commit 00aad4c

15 files changed

+875
-43
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ConduitIO/conduit-core
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 🚀 Feature Request
2+
description: Request a new feature.
3+
title: "Feature: <title>"
4+
labels: [feature, triage]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Feature description
9+
description: A clear and concise description of what you want to happen and what problem will this solve.
10+
validations:
11+
required: true

.github/ISSUE_TEMPLATE/2-bug.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 🐛 Bug
2+
description: Report a bug.
3+
title: "Bug: <title>"
4+
labels: [bug, triage]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Bug description
9+
description: A concise description of what you're experiencing and what you expected to happen instead.
10+
validations:
11+
required: true
12+
- type: textarea
13+
attributes:
14+
label: Steps to reproduce
15+
description: Steps to reproduce the behavior.
16+
validations:
17+
required: true
18+
- type: input
19+
attributes:
20+
label: Version
21+
placeholder: v0.4.0
22+
validations:
23+
required: true

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: ❓ Ask a Question
4+
url: https://github.com/ConduitIO/conduit/discussions
5+
about: Please ask and answer questions here.
6+
- name: 📄 Documentation Issue
7+
url: https://github.com/ConduitIO/conduit-site
8+
about: Please report issues regarding documentation here.

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Docs: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
commit-message:
11+
prefix: ".github:"
12+
13+
# Maintain dependencies for Go
14+
- package-ecosystem: "gomod"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
commit-message:
19+
prefix: "go.mod:"

.github/pull_request_template.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Description
2+
3+
Please include a summary of the change and what type of change it is (new feature, bug fix, refactoring, documentation).
4+
Please also include relevant motivation and context.
5+
List any dependencies that are required for this change.
6+
7+
Fixes # (issue)
8+
9+
### Quick checks:
10+
11+
- [ ] I have followed the [Code Guidelines](https://github.com/ConduitIO/conduit/blob/main/docs/code_guidelines.md).
12+
- [ ] There is no other [pull request](https://github.com/ConduitIO/benchi/pulls) for the same update/change.
13+
- [ ] I have written unit tests.
14+
- [ ] I have made sure that the PR is of reasonable size and can be easily reviewed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This action automatically merges dependabot PRs that update go dependencies (only patch and minor updates).
2+
# Based on: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
3+
4+
name: Dependabot auto-merge
5+
on:
6+
pull_request:
7+
# Run this action when dependabot labels the PR, we care about the 'go' label.
8+
types: [labeled]
9+
10+
permissions:
11+
pull-requests: write
12+
contents: write
13+
14+
jobs:
15+
dependabot-go:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.actor == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'go') }}
18+
steps:
19+
- name: Dependabot metadata
20+
id: metadata
21+
uses: dependabot/[email protected]
22+
with:
23+
github-token: "${{ secrets.GITHUB_TOKEN }}"
24+
25+
- name: Approve PR
26+
# Approve only patch and minor updates
27+
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
28+
run: gh pr review --approve "$PR_URL"
29+
env:
30+
PR_URL: ${{ github.event.pull_request.html_url }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Enable auto-merge for Dependabot PRs
34+
# Enable auto-merging only for patch and minor updates
35+
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
36+
run: gh pr merge --auto --squash "$PR_URL"
37+
env:
38+
PR_URL: ${{ github.event.pull_request.html_url }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
golangci-lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: 'go.mod'
16+
17+
# This step sets up the variable steps.golangci-lint-version.outputs.v
18+
# to contain the version of golangci-lint (e.g. v1.54.2).
19+
# The version is taken from go.mod.
20+
- name: Golangci-lint version
21+
id: golangci-lint-version
22+
run: |
23+
GOLANGCI_LINT_VERSION=$( go list -m -f '{{.Version}}' github.com/golangci/golangci-lint )
24+
echo "v=$GOLANGCI_LINT_VERSION" >> "$GITHUB_OUTPUT"
25+
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v6
28+
with:
29+
version: ${{ steps.golangci-lint-version.outputs.v }}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: project-management
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
project-mgmt:
9+
uses: ConduitIO/automation/.github/workflows/project-automation.yml@main
10+
secrets:
11+
project-automation-token: ${{ secrets.PROJECT_AUTOMATION }}

.github/workflows/test.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: 'go.mod'
18+
19+
- name: Test
20+
run: make test GOTEST_FLAGS="-v -count=1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: validate-generated-files
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
validate-generated-files:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: 'go.mod'
18+
19+
- name: Check generated files
20+
run: |
21+
export PATH=$PATH:$(go env GOPATH)/bin
22+
make install-tools generate
23+
git diff
24+
git diff --exit-code --numstat

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ fmt:
1212

1313
.PHONY: install-tools
1414
install-tools:
15-
go mod tidy
15+
@echo Installing tools from tools.go
16+
@go list -e -f '{{ join .Imports "\n" }}' tools.go | xargs -I % go list -f "%@{{.Module.Version}}" % | xargs -tI % go install %
17+
@go mod tidy
1618

1719
.PHONY: generate
1820
generate:

0 commit comments

Comments
 (0)