From 5261ee927eb1b8c34fe520839e3c187628096609 Mon Sep 17 00:00:00 2001 From: Arkadiy Kukarkin Date: Tue, 26 May 2026 21:55:09 +0200 Subject: [PATCH] chore: add CI, dependabot, and release workflow --- .github/dependabot.yml | 22 +++++++++++++++++++++ .github/workflows/ci.yml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 25 ++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b81d400 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + # go modules -- one grouped PR for everything + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly + groups: + go-deps: + patterns: ["*"] + + # dockerfile base images (golang, alpine) + - package-ecosystem: docker + directory: / + schedule: + interval: weekly + + # the workflow actions themselves + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..783bb00 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci +on: + push: + branches: [main] + pull_request: +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + services: + redis: + image: redis:alpine + ports: + - 6379:6379 + env: + TEST_REDIS_ADDR: localhost:6379 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - run: go build ./... + - run: go vet ./... + - run: go test ./... + vuln: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - uses: golang/govulncheck-action@v1 + with: + go-version-file: go.mod diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a1a1d8a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +# rolling :latest image, published manually from the Actions tab (Run workflow) +name: release +on: + workflow_dispatch: +permissions: + contents: read + packages: write +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ghcr.io/parkan/go-hauk:latest + ghcr.io/parkan/go-hauk:${{ github.sha }}