Skip to content

Commit

Permalink
Merge pull request #10 from jplanckeel/refacto/rework-project
Browse files Browse the repository at this point in the history
refacto: rework github project
  • Loading branch information
jplanckeel authored Feb 13, 2024
2 parents 963bc49 + cebfd38 commit eccd085
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 46 deletions.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
title: '🐛 [BUG] - <title>'
labels: bug
assignees: ''

---

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

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

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

**Details (please complete the following information):**
- Scope version:
- Platform:
- Golang version:

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 💡 Feature request
about: Suggest an idea for this project
title: '💡 [REQUEST] - <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.
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

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

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
open-pull-requests-limit: 4
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
open-pull-requests-limit: 2
70 changes: 61 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,77 @@
name: docker build
name: Release

on:
push:
branches:
- 'main'
- main
tags:
- 'v*.*.*'
pull_request:
types:
- labeled

jobs:
docker:
release:
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3

- name: Bump version on merging Pull Requests with specific labels
id: bumpr
if: "!startsWith(github.ref, 'refs/tags/')"
uses: haya14busa/action-bumpr@v1

- name: Update corresponding major and minor tag
uses: haya14busa/action-update-semver@v1
if: "!steps.bumpr.outputs.skip"
with:
tag: ${{ steps.bumpr.outputs.next_version }}

- name: Get tag name
id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}

- id: version_tag
run: echo "::set-output name=tag::$(echo ${{steps.tag.outputs.value}} | cut -c 2-)"

- name: Create release
uses: shogo82148/actions-create-release@v1
if: "steps.tag.outputs.value != ''"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.tag.outputs.value }}
release_name: Release ${{ steps.tag.outputs.value }}
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false

- uses: actions/setup-go@v4
if: "steps.tag.outputs.value != ''"
with:
go-version: '>=1.18.0'

- name: Login to Docker Hub
uses: docker/login-action@v2
if: "steps.tag.outputs.value != ''"
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

username: ${{secrets.DOCKER_USERNAME}}
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: jplanckeel/scope:latest
tags: jplanckeel/scope:${{steps.version_tag.outputs.tag}}

release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
42 changes: 33 additions & 9 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,58 @@ jobs:
runs-on: ubuntu-latest
steps:

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

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '>=1.21.0'

- name: Check out code into the Go module directory
uses: actions/checkout@v3
go-version: stable

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=30m

test:
name: Go test
security:
name: Go Security
runs-on: ubuntu-latest
steps:

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

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '>=1.21.0'
go-version: stable

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...

- name: Install Govulncheck Security Scanner
run: go get golang.org/x/vuln/cmd/govulncheck && go install golang.org/x/vuln/cmd/govulncheck

- name: Run Govulncheck Security Scanner
run: govulncheck ./...

test:
name: Go test
runs-on: ubuntu-latest
steps:

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

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable

- name: Install
run: go install
run: go mod download -x

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

0 comments on commit eccd085

Please sign in to comment.