Skip to content

Commit

Permalink
ci: Add build, test, release workflow pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetumit committed Oct 30, 2023
1 parent 5d32ceb commit 4b403a0
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build And Test

on:
push:
# Does not run on a tag push
branches:
- "*"
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
Build:
strategy:
matrix:
go-version: [1.21.0]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v2
- name: Tidy
run: go mod tidy
- name: Build
run: ./scripts/build.sh
- name: Test
run: go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
docker-build:
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v3
- name: Build Image
run: make docker-build
- name: Run Image
run: make docker-run
- name: Deploy Image
run: echo 'TODO'

golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 comments on commit 4b403a0

Please sign in to comment.