Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Dec 17, 2023
0 parents commit e58fc3c
Show file tree
Hide file tree
Showing 34 changed files with 1,779 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/internal/odoo/* linguist-generated=true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @arnested
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

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

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
blank_issues_enabled: true
contact_links:
- name: Ask a question or get support
url: https://github.com/spejder/aarsstjerner/discussions
about: Please use the discussions forum
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---
**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 screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Security Policy

## Supported Versions

Latest version.

## Reporting a Vulnerability

Security issues can be reported to [Arne Jørgensen](https://github.com/arnested)
either by [mail](mailto:[email protected]) or any other channel you prefer and
trust (see my [Keybase profile](https://keybase.io/arnested)).
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
timezone: Europe/Copenhagen
reviewers:
- arnested
- package-ecosystem: docker
directory: /
schedule:
interval: daily
timezone: Europe/Copenhagen
reviewers:
- arnested
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
timezone: Europe/Copenhagen
reviewers:
- arnested
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
Please describe the bug fix or feature you would like to introduce.
-->
50 changes: 50 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Lint
on: pull_request

jobs:
dockerfile:
name: dockerfile
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run hadolint
uses: hadolint/[email protected]
with:
trusted-registries: docker.io

yamllint:
name: Yamllint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run Yamllint
uses: frenck/[email protected]
with:
strict: true

markdownlint:
name: markdown
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v13

golangci-lint:
name: go
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: arnested/go-version-action@v1
id: go-version
- name: Setup Go ${{ steps.go-version.outputs.minimal }}
uses: WillAbides/[email protected]
with:
go-version: ${{ steps.go-version.outputs.minimal }}
- run: go version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Release

on:
workflow_run:
workflows: ["Build and test"]
branches: [main]
types:
- completed

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/[email protected]
id: version
env:
GITHUB_TOKEN: ${{ github.token }}
WITH_V: true
DEFAULT_BUMP: patch
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
- uses: arnested/go-version-action@v1
id: go-version
- name: Set up Go ${{ steps.go-version.outputs.latest }}.x
uses: WillAbides/[email protected]
with:
go-version: ${{ steps.go-version.outputs.latest }}.x
ignore-local: true
- run: go version
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release
env:
GITHUB_TOKEN: ${{ github.token }}
44 changes: 44 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Build and test
on:
- push

permissions:
contents: read

jobs:
go-version:
name: Lookup go versions
runs-on: ubuntu-latest
outputs:
minimal: ${{ steps.go-version.outputs.minimal }}
matrix: ${{ steps.go-version.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: arnested/go-version-action@v1
id: go-version
build_and_test:
name: Build and test
needs: go-version
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ${{ fromJSON(needs.go-version.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}.x
uses: WillAbides/[email protected]
with:
go-version: ${{ matrix.go-version }}.x
ignore-local: true
- run: go version
- name: go test
env:
# We enable cgo to be able to test with `-race`.
CGO_ENABLED: 1
run: >-
go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
flags: go${{ matrix.go-version }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.envrc
/aarsstjerner
/dist
27 changes: 27 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
linters:
enable-all: true
disable:
- depguard
- exhaustruct
- exhaustivestruct

linters-settings:
exhaustive:
# indicates that switch statements are to be considered exhaustive if a
# 'default' case is present, even if all enum members aren't listed in the
# switch
default-signifies-exhaustive: true
errcheck:
check-blank: true
check-type-assertions: true

run:
skip-dirs:
- internal/ms

issues:
exclude-rules:
- path: _test\.go
linters:
- ifshort
25 changes: 25 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
builds:
- env:
- CGO_ENABLED=0
archives:
- format: binary
name_template: >-
{{ .ProjectName }}_
{{- if eq .Os "linux" }}Linux
{{- else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
prerelease: auto
3 changes: 3 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
MD013:
code_blocks: false
17 changes: 17 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
extends: default

ignore-from-file:
- .gitignore

rules:
indentation:
spaces: 2
line-length: disable
truthy:
check-keys: false
braces:
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
Loading

0 comments on commit e58fc3c

Please sign in to comment.