Skip to content

Commit

Permalink
Merge remote-tracking branch 'builder/jpkrohling/move-to-subdirectory…
Browse files Browse the repository at this point in the history
…' into jpkrohling/move-builder
  • Loading branch information
jpkrohling committed Oct 28, 2021
2 parents db6d31e + 075d83a commit c7b2497
Show file tree
Hide file tree
Showing 28 changed files with 2,063 additions and 0 deletions.
15 changes: 15 additions & 0 deletions builder/.github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#####################################################
#
# List of approvers for OpenTelemetry Collector Builder
#
#####################################################
#
# Learn about membership in OpenTelemetry community:
# https://github.com/open-telemetry/community/blob/master/community-membership.md
#
#
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#

* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers
19 changes: 19 additions & 0 deletions builder/.github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pull_request_rules:
- name: remove outdated reviews
conditions:
- base=main
actions:
dismiss_reviews: {}

- name: Automatic merge when all checks pass and the PR is approved
conditions:
- "#approved-reviews-by>=1"
- "-draft"
- "status-success=Unit tests"
- "status-success=Code standards (linting)"
- "status-success=Security"
- "status-success=Integration test"
actions:
merge:
method: squash
commit_message: title+body
56 changes: 56 additions & 0 deletions builder/.github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Continuous Integration"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-20.04
steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test
run: go test -v ./...

lint:
name: Code standards (linting)
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: --enable=gosec,maligned,misspell
only-new-issues: true

security:
name: Security
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
24 changes: 24 additions & 0 deletions builder/.github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Integration tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
integration-test:
name: Integration test
runs-on: ubuntu-20.04
steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test
run: ./test/test.sh
29 changes: 29 additions & 0 deletions builder/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: goreleaser

on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions builder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

# Created by https://www.toptal.com/developers/gitignore/api/go,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

### Go Patch ###
/vendor/
/Godeps/

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### goland ###
.idea

# End of https://www.toptal.com/developers/gitignore/api/go,vscode

/dist/
opentelemetry-collector-builder
18 changes: 18 additions & 0 deletions builder/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# all available settings of specific linters
linters-settings:
goheader:
template-path: header.txt
goimports:
local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder
maligned:
suggest-new: true
misspell:
locale: US

linters:
enable:
- goheader
- goimports
- maligned
- misspell
- gosec
33 changes: 33 additions & 0 deletions builder/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
before:
hooks:
- go mod download
builds:
- flags:
- -trimpath
ldflags:
- -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7
archives:
- format: binary
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
Loading

0 comments on commit c7b2497

Please sign in to comment.