Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
insidieux committed Dec 17, 2020
0 parents commit 308fa19
Show file tree
Hide file tree
Showing 53 changed files with 3,857 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @insidieux
* @Sigthror
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: insidieux, Sigthror

---

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:
- Run binary with flags '...'
- ...
- See error

**Expected behavior**

A clear and concise description of what you expected to happen.

**Environment:**

- Version: [e.g. v1.0.0]
- GOOS: [e.g. linux, darwin]

**Additional context**

- Logs
- Stacktrace

Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: insidieux, Sigthror

---

**Is your feature request related to a problem? Please describe.**

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context or information about the feature request here.
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**Description**

Please include a summary of the change and which issue was fixed.
Please also include relevant motivation and context.

Fixes # (issue)

**Type of change**

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

**Checklist**
- [ ] This PR contains documentation
- [ ] This PR contains tests
- [ ] This PR has been tested for backwards compatibility
181 changes: 181 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: CI

on:
push:
branches:
- '*'
tags:
- 'v*'
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
test:
name: Test
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache vendor
id: cache-vendor
uses: actions/cache@v2
with:
path: vendor
key: ${{ github.sha }}
- name: Vendoring
if: steps.cache-vendor.outputs.cache-hit != 'true'
run: make vendor
- name: Generate wire injectors
run: make wire
- name: Lint
run: make lint
- name: Run tests
run: make test
- name: Send code coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: test/coverage.out

binary:
name: Build binary
runs-on: ubuntu-18.04
needs: test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
matrix:
goos: [ darwin, linux, windows ]
goarch: [ amd64 ]
max-parallel: 3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache vendor
id: cache-vendor
uses: actions/cache@v2
with:
path: vendor
key: ${{ github.sha }}
- name: Vendoring
if: steps.cache-vendor.outputs.cache-hit != 'true'
run: make vendor
- name: Generate wire injectors
run: make wire
- name: Get tag reference
id: get-tag-reference
uses: ankitvgupta/ref-to-tag-action@master
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Build
run: make build GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} BUIlD_VERSION="${{ steps.get-tag-reference.outputs.tag }}"
- name: Upload compiled binary
uses: actions/upload-artifact@v2
with:
name: pinchy-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin/pinchy

image:
name: Push docker image
runs-on: ubuntu-18.04
needs: binary
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
matrix:
goos: [ linux ]
goarch: [ amd64 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download compiled binary
uses: actions/download-artifact@v2
with:
name: pinchy-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin
- name: Get tag reference
id: get-tag-reference
uses: ankitvgupta/ref-to-tag-action@master
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Build docker image for github registry
run: |
make docker-image-build DOCKER_TAG=${{ steps.get-tag-reference.outputs.tag }}
- name: Push docker image to github registry
run: |
make docker-image-push \
DOCKER_USER=${{ github.actor }} \
DOCKER_PASSWORD=${{ secrets.GITHUB_TOKEN }} \
DOCKER_TAG=${{ steps.get-tag-reference.outputs.tag }}
- name: Build docker image for github registry as latest
run: |
make docker-image-build DOCKER_TAG="latest"
- name: Push docker image to github registry as latest
run: |
make docker-image-push \
DOCKER_USER=${{ github.actor }} \
DOCKER_PASSWORD=${{ secrets.GITHUB_TOKEN }} \
DOCKER_TAG="latest"
- name: Build docker image for docker hub registry
run: |
make docker-image-build \
DOCKER_IMAGE=${{ github.repository }} \
DOCKER_TAG=${{ steps.get-tag-reference.outputs.tag }}
- name: Push docker image to docker hub registry
run: |
make docker-image-push \
DOCKER_REGISTRY=docker.io \
DOCKER_IMAGE=${{ github.repository }} \
DOCKER_USER=${{ secrets.DOCKER_HUB_USERNAME }} \
DOCKER_PASSWORD=${{ secrets.DOCKER_HUB_PASSWORD }} \
DOCKER_TAG=${{ steps.get-tag-reference.outputs.tag }}
- name: Build docker image for docker hub registry as latest
run: |
make docker-image-build \
DOCKER_IMAGE=${{ github.repository }} \
DOCKER_TAG="latest"
- name: Push docker image to docker hub registry as latest
run: |
make docker-image-push \
DOCKER_REGISTRY=docker.io \
DOCKER_IMAGE=${{ github.repository }} \
DOCKER_USER=${{ secrets.DOCKER_HUB_USERNAME }} \
DOCKER_PASSWORD=${{ secrets.DOCKER_HUB_PASSWORD }} \
DOCKER_TAG="latest"
release:
name: Upload release asset
runs-on: ubuntu-18.04
needs: binary
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
strategy:
matrix:
goos: [ darwin, linux, windows ]
goarch: [ amd64 ]
max-parallel: 3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download compiled binary
uses: actions/download-artifact@v2
with:
name: pinchy-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin
- name: Tar artifact
run: tar -zcvf pinchy-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C bin pinchy
- name: Get tag reference
id: get-tag-reference
uses: ankitvgupta/ref-to-tag-action@master
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pinchy-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
asset_name: pinchy-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
tag: ${{ steps.get-tag-reference.outputs.tag }}
release_name: Pinchy ${{ steps.get-tag-reference.outputs.tag }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.idea
/vendor

mock_*_test.go
wire_gen.go
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
run:
timeout: 5m
tests: false
skip-dirs:
- vendor
modules-download-mode: vendor
11 changes: 11 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is the official list of Pinchy authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.

# Names should be added to this file as
# Individual's name <submission email address>

# Please keep the list sorted.
Ageev Pavel <[email protected]>
Artem Mezentsev <[email protected]>

9 changes: 9 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is the official list of people who can contribute
# (and typically have contributed) code to the Pinchy repository.
# The AUTHORS file lists the copyright holders; this file
# lists people.

# Names should be added to this file like so:
# Individual's name <submission email address>

# Please keep the list sorted.
Loading

0 comments on commit 308fa19

Please sign in to comment.