Skip to content

Commit

Permalink
feat: add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Dec 22, 2023
1 parent ae13581 commit 48bf456
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/run-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Pull request/Push: Run unit test'

on:
pull_request:
branches:
- dev
- master
- main
- beta
push:
branches:
- dev
- master
- main
- beta

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Download dependencies
run: go mod download

- name: Vet
run: |
go vet ./...
- name: Test
run: |
go test -v -coverpkg ./src/app/... -coverprofile coverage.out -covermode count ./src/app/...
go tool cover -func="./coverage.out"
35 changes: 35 additions & 0 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Pull request/Push: Build test'

on:
pull_request:
branches:
- dev
- master
- main
- beta
push:
branches:
- dev
- master
- main
- beta

jobs:
docker-build:
name: 'Docker build and create an image'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: test

0 comments on commit 48bf456

Please sign in to comment.