Skip to content

Commit

Permalink
Update project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
srueg committed Apr 20, 2021
1 parent 72871ea commit 3bb6d95
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 56 deletions.
28 changes: 28 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
plugins:
shellcheck:
enabled: true
govet:
enabled: true
gofmt:
enabled: true
golint:
enabled: true
fixme:
enabled: true
exclude_patterns:
- 'config/'
- 'db/'
- 'dist/'
- 'features/'
- '**/node_modules/'
- 'script/'
- '**/spec/'
- '**/test/'
- '**/tests/'
- 'Tests/'
- '**/vendor/'
- '**/*_test.go'
- '**/*.d.ts'
- 'e2e/lib/'
- '**/zz_generated.deepcopy.go'
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

[Makefile]
indent_style = tab

[{*.go, go.mod, *.bats, *.bash}]
indent_style = tab

[{*.yml, *.json, *.css, *.js}]
indent_style = space
indent_size = 2
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: 🐛 Bug report
about: Create a report to help us improve 🎉
title: ''
labels: 'bug'

---
## Describe the bug

A clear and concise description of what the bug is.

## Additional context

Add any other context about the problem here.

## Logs

If applicable, add logs to help explain your problem.
```console

```

## Expected behavior

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

## To Reproduce

Steps to reproduce the behavior:
1. Specs
```yaml

```
2. Commands
```bash

```

## Environment (please complete the following information):

- Image Version: e.g. v1.0
- K8s Version: e.g. v1.18
- K8s Distribution: e.g. OpenShift, Rancher, etc.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Question
url: https://github.com/appuio/seiso/discussions
about: Ask or discuss with us, we're happy to help 🙋
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 🚀 Feature request
about: Suggest an idea for this project 💡
title: ''
labels: 'enhancement'

---
## Summary

**As** "role name"\
**I want** "a feature or functionality"\
**So that** "I get certain business value"

## Context

Add more information here. You are completely free regarding form and length.

## Out of Scope

* List aspects that are explicitly not part of this feature

## Further links

* URLs of relevant Git repositories, PRs, Issues, etc.

## Acceptance criteria

<!--
If you already have ideas what the requirements are, please list them below in given-when-then expressions.
-->

* Given a precondition, when an action happens, then expect a result

## Implementation Ideas

* If applicable, shortly list possible implementation ideas
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Summary



<!--
Thank you for your pull request. Please provide a description above and
review the checklist below.
-->

## Checklist
<!--
Remove items that do not apply. For completed items, change [ ] to [x].
-->

- [ ] Keep pull requests small so they can be easily reviewed.
- [ ] Categorize the PR by setting a good title and adding one of the labels:
`bug`, `enhancement`, `documentation`, `change`, `breaking`,
as they show up in the changelog
- [ ] Update the documentation.
- [ ] Update tests.
- [ ] Link this PR to related issues.

<!--
NOTE: these things are not required to open a PR and can be done afterwards,
while the PR is open.
-->
30 changes: 30 additions & 0 deletions .github/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["enhancement", "feature"]
},
{
"title": "## 🛠️ Minor Changes",
"labels": ["change"]
},
{
"title": "## 🔎 Breaking Changes",
"labels": ["breaking"]
},
{
"title": "## 🐛 Fixes",
"labels": ["bug", "fix"]
},
{
"title": "## 📄 Documentation",
"labels": ["documentation"]
},
{
"title": "## 🔗 Dependency Updates",
"labels": ["dependency"]
}
],
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}"
}
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
---
name: Build

on:
push:
branches:
- "*"
tags-ignore:
- "*"
- master
pull_request:
types: [opened, reopened]

env:
GO_VERSION: "^1.15.2"
branches:
- master

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
---
name: Lint

on:
pull_request: {}
push:
branches:
- "*"
tags-ignore:
- "*"
pull_request:
types: [opened, reopened]

env:
GO_VERSION: "^1.15.2"
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Master

on:
push:
branches:
- master

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build docker images
run: make docker-build -e IMG_TAG=${GITHUB_REF#refs/heads/}
- name: Login to Docker hub
run: docker login -u "${{ secrets.DOCKER_HUB_USER }}" -p "${{ secrets.DOCKER_HUB_PASSWORD }}"
- name: Login to quay.io
run: docker login -u "${{ secrets.QUAY_IO_USER }}" -p "${{ secrets.QUAY_IO_PASSWORD }}" quay.io
- name: Push docker images
run: make docker-push -e IMG_TAG=${GITHUB_REF#refs/heads/}
31 changes: 23 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
name: Release

on:
push:
tags:
- "*"

env:
GO_VERSION: "^1.15.2"

jobs:
goreleaser:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -30,9 +28,26 @@ jobs:
with:
gpg-private-key: ${{ secrets.SIGNING_KEY }}
- name: Login to Docker hub
run: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
- uses: goreleaser/goreleaser-action@v2
run: docker login -u "${{ secrets.DOCKER_HUB_USER }}" -p "${{ secrets.DOCKER_HUB_PASSWORD }}"
- name: Login to quay.io
run: docker login -u "${{ secrets.QUAY_IO_USER }}" -p "${{ secrets.QUAY_IO_PASSWORD }}" quay.io
- name: Generate artifacts
run: make crd
- name: Build changelog from PRs with labels
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: ".github/changelog-configuration.json"
# PreReleases still get a changelog, but the next full release gets a diff since the last full release,
# combining possible changelogs of all previous PreReleases in between. PreReleases show a partial changelog
# since last PreRelease.
ignorePreReleases: "${{ !contains(github.ref, '-rc') }}"
outputFile: .github/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish releases
uses: goreleaser/goreleaser-action@v2
with:
args: release
args: release --release-notes .github/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
---
name: Test

on:
push:
branches:
- "*"
tags-ignore:
- "*"
- master
pull_request:
types: [opened, reopened]

env:
GO_VERSION: "^1.15.2"
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # some unit tests test the Git integration with our own git history
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -29,5 +26,5 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run test suite
- name: Run tests
run: make test

0 comments on commit 3bb6d95

Please sign in to comment.