From 690c171d3d83a8f025c84e871ae670580072d19d Mon Sep 17 00:00:00 2001 From: franklin Date: Thu, 4 Jul 2024 13:14:09 +0200 Subject: [PATCH] chore: add github actions --- .github/dependabot.yml | 19 +++++++++++++++++++ .github/workflows/pr.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/tag.yml | 29 +++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pr.yml create mode 100644 .github/workflows/tag.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e82631a --- /dev/null +++ b/.github/dependabot.yml @@ -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: ['*'] diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..51811e1 --- /dev/null +++ b/.github/workflows/pr.yml @@ -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 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..426af15 --- /dev/null +++ b/.github/workflows/tag.yml @@ -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 }}