Skip to content

Commit

Permalink
github actions: initial setup
Browse files Browse the repository at this point in the history
This enables two jobs:
- tests
- release

Tests job will run go test and linter on master branch and PRs
Release job will trigger the goreleaser on tags matching semver pattern
  • Loading branch information
sydorovdmytro committed Nov 6, 2020
1 parent 0c45ba3 commit 28500cd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: goreleaser

on:
push:
tags:
- v[0-9].[0-9]+.[0-9]+

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.13
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: run tests
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.13'
- name: Checkout code
uses: actions/checkout@v2
- name: Download mods
run: go mod download
- name: Run tests
run: go test
- name: Install package locally
run: go install .

0 comments on commit 28500cd

Please sign in to comment.