Skip to content

Commit

Permalink
Replace dep with go mod, migrate from travis to github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
erickskrauch committed Dec 12, 2023
1 parent 980c920 commit 6accffe
Show file tree
Hide file tree
Showing 17 changed files with 273 additions and 501 deletions.
13 changes: 0 additions & 13 deletions .fossa.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build

on:
push:
branches:
- '**'
tags:
- '*.*.*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest

services:
redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
cache-dependency-path: go.sum
go-version-file: go.mod

- name: Install dependencies
run: go get .

- name: Go Format
run: gofmt -s -w . && git diff --exit-code

- name: Go Vet
run: go vet ./...

- name: Go Test
run: go test -v -race --tags redis -coverprofile=coverage.txt -covermode=atomic ./...

- name: Build
run: go build ./...
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_run:
workflows:
- Build
types:
- completed
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- id: meta
name: Docker meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 6accffe

Please sign in to comment.