Skip to content

Commit

Permalink
Merge pull request #1 from lindell/github-actions
Browse files Browse the repository at this point in the history
Migrated from travis to github actions
  • Loading branch information
lindell authored Jul 26, 2020
2 parents fcd2ce7 + 5ffe3eb commit b18f350
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 23 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Coverage
on: [push, pull_request]
jobs:
test:
name: Test with Coverage
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: '1.14'
- name: Check out code
uses: actions/checkout@v2
- name: Run Unit tests
run: |
go test -race -covermode atomic -coverprofile=profile.cov ./pkg/...
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
21 changes: 21 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Go
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Test
run: go test ./...

- name: Build
run: go build cmd/revaboxy/main.go
11 changes: 11 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: reviewdog
on: [pull_request]
jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- "*"

name: Release

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Test
run: echo $HOME
- name: Test2
run: pwd

- name: Generate release notes
run: |
export TAG_NAME=$(echo $GITHUB_REF | sed -E 's/^refs\/tags\///')
export DOCKER_VERSION=$(echo $TAG_NAME | sed -E 's/v([0-9]\.[0-9]\.[0-9])/\1/')
envsubst < ./deployments/CHANGELOG.md > /home/runner/CHANGELOG_generated.md
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --release-notes="/home/runner/CHANGELOG_generated.md"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
./deployments/CHANGELOG_generated.md
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
builds:
- main: ./cmd/revaboxy/main.go
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- 386
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: arm
- goos: darwin
goarch: arm64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
arm: ARM
arm64: ARM64
format: binary
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
release:
draft: true
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions deployments/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Binaries for linux, mac and windows are included in this github release
----
| Name | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------ |
| `lindell/revaboxy:$TRAVIS_TAG` | Minimal image, made from the [scratch](https://hub.docker.com/_/scratch) image. Probably everything you need |
| `lindell/revaboxy:$TRAVIS_TAG-alpine` | Image based on [alpine](https://hub.docker.com/_/alpine). If you need a shell and package manager |
| `lindell/revaboxy:$DOCKER_VERSION` | Minimal image, made from the [scratch](https://hub.docker.com/_/scratch) image. Probably everything you need |
| `lindell/revaboxy:$DOCKER_VERSION-alpine` | Image based on [alpine](https://hub.docker.com/_/alpine). If you need a shell and package manager |

Docker images are found at dockerhub [lindell/revaboxy](https://hub.docker.com/r/lindell/revaboxy)

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/lindell/revaboxy

go 1.14

0 comments on commit b18f350

Please sign in to comment.