chore: add github actions

This commit is contained in:
franklin 2024-07-04 13:14:09 +02:00
parent aa9bbbe665
commit 690c171d3d
No known key found for this signature in database
3 changed files with 81 additions and 0 deletions

19
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
- package-ecosystem: gomod
directory: '/'
schedule:
interval: weekly
groups:
gomod-security:
applies-to: security-updates
patterns: ['*']
gomod-update:
applies-to: version-updates
patterns: ['*']

33
.github/workflows/pr.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: PR check
on:
push:
branches: [ main ]
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: golangci/golangci-lint-action@v4
with:
version: latest
- name: Run tests
run: make test

29
.github/workflows/tag.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Release Tag
on:
push:
tags:
- v*.*.*
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}