Skip to content

Commit

Permalink
ci: update liatrio otel collector distribution with functioning skele…
Browse files Browse the repository at this point in the history
…ton (#25)

* fix: make run issue

Co-authored-by: Adriel Perkins <[email protected]>:wq

* docs: add contrib, update readme, add codeowners

Co-authored-by: Adriel Perkins <[email protected]>

* chore: bump ocb version in makefile

Co-authored-by: Adriel Perkins <[email protected]>

* ci: add semver pr check workflow

Co-authored-by: Adriel Perkins <[email protected]>

* chore: add pre-commit config

Co-authored-by: Adriel Perkins <[email protected]>

* chore: remove talisman

Co-authored-by: Adriel Perkins <[email protected]>

* ci: add pr labeler and rename pr conventional lint

Co-authored-by: Adriel Perkins <[email protected]>

* refactor: move around go src and update makefile to support change

Co-authored-by: Adriel Perkins <[email protected]>

* chore: add make cibuild command

Co-authored-by: Adriel Perkins <[email protected]>

* ci: add boilerplate ci code

Co-authored-by: Adriel Perkins <[email protected]>

* feat: add go releaser to release binaries inplace of ocb

* ci: add latest ci changes

Co-authored-by: Adriel Perkins <[email protected]>

---------

Co-authored-by: Adriel Perkins <[email protected]>
Co-authored-by: Adriel Perkins <[email protected]>
  • Loading branch information
3 people authored Jul 14, 2023
1 parent 1100844 commit 61d3355
Show file tree
Hide file tree
Showing 56 changed files with 807 additions and 1,710 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners

# Default owners for everything in the repo
* @liatrio/o11y-owners
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

labels:
- skip-changelog

- package-ecosystem: "gomod"
directory: "/pkg"
schedule:
interval: "daily"

labels:
- skip-changelog

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"

labels:
- skip-changelog
15 changes: 15 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Add 'documentation' label to any change to *.md files
documentation:
- any: ['**/*.md']

# Add 'docker' label to any change in docker related files
docker:
- any: ['**/Dockerfile*', '**/.dockerignore']

# Add 'github_actions' label to any change .github/ directory
github_actions:
- any: ['.github/**']

# Add 'go' label to any change *.go files
go:
- any: ['**/*.go']
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build, Test and Release

on:
push:
branches:
- main

jobs:
golangci:
strategy:
matrix:
go: ['1.19']
os: [ubuntu-latest, macos-latest, windows-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.53

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
#
# Note: by default the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"

make-build-checks:
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
cache: false

- name: Build OpenTelemetry Collector
run: make cibuild

- name: Run Checks
run: make checks

go-semnatic-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Run go-semantic-release
uses: go-semantic-release/action@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/pr_conventional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Lint PR

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title (Convention Commit)
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PRs labeler

on:
- pull_request_target

jobs:
triage:
runs-on: ubuntu-20.04
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ build/*
!build/.vscode/*
ocb
tmp

dist/
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
# - go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
- make cibuild
builds:
- dir: ./build
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: pretty-format-json
types: [file] # override `types: [json]`
files: \.(json|json.tpl)$
args: [--autofix, --no-sort-keys]
stages: [commit]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.1 # or other specific tag
hooks:
- id: yamlfmt
stages: [commit]
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing to liatrio-otel-collector

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features

## We Develop with Github

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [Coding Conventions, e.g., PEP8], So Pull Requests Need To Pass This.

TODO: Include information about the coding style guide or conventions that you use. If there are any tools that they should use or any checks that their code needs to pass, detail them here.

## All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the [Software License]

Explain that when someone submits a contribution, they are agreeing that the project owner can use their contribution under the project's license.

## Report bugs using Github's [issues](https://github.com/liatrio/liatrio-otel-collector/issues)

We use GitHub issues to track public bugs. Report a bug by opening a new issue; it's that easy!

## Write bug reports with detail, background, and sample code

Great Bug Reports tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## Use a Consistent Coding Style

TODO: Detail the style guide and coding conventions further, if needed.

## License

By contributing, you agree that your contributions will be licensed under its [License Name].

## References

Include any references or resources that might be helpful for the contributor.

Thank you for considering contributing to liatrio-otel-collector!
Loading

0 comments on commit 61d3355

Please sign in to comment.