Skip to content

Commit

Permalink
use golang-ci action
Browse files Browse the repository at this point in the history
drop pre-commit
bump gcov2lcov version
  • Loading branch information
jandelgado committed Oct 17, 2020
1 parent e74881e commit 37a8870
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ jobs:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
- name: Install golangci-lint
run: |
go get github.com/golangci/golangci-lint/cmd/golangci-lint
- name: Run linters
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
./pre-commit
uses: golangci/golangci-lint-action@v2
with:
version: v1.29

test:
strategy:
Expand Down Expand Up @@ -55,13 +52,10 @@ jobs:
- name: Calc coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/[email protected]
- name: Coveralls
uses: coverallsapp/github-action@v1.0.1
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
Expand Down
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# golang ci template using github actions

**WORK IN PROGRESS, but can already be used**

[![Build Status](https://github.com/jandelgado/golang-ci-template-github-actions/workflows/test%20and%20build/badge.svg)](https://github.com/jandelgado/golang-ci-template-github-actions/actions?workflow=test%20and%20build)
[![Coverage Status](https://coveralls.io/repos/github/jandelgado/golang-ci-template-github-actions/badge.svg?branch=master)](https://coveralls.io/github/jandelgado/golang-ci-template-github-actions?branch=master)
Expand All @@ -20,23 +19,19 @@

This repository serves as a template for github-actions integrated go projects.
It consists of a `hello, world!` like example in source file `main.go` which
gets compiled into binary `golang-ci-template-github-actions`. The `pre-commit`
script runs some checks on the code, before the unit tests are executed. When
the build stage was successful, build artifacts are uploaded and available
in the CI job status.
gets compiled into binary `golang-ci-template-github-actions`. The CI runs some
[linters](https://github.com/golangci/golangci-lint-action) on the code, before
the unit tests are executed. When the build stage was successful, build
artifacts are uploaded and available in the CI job status.

When a new release is created, the released-artifacts are automatically
uploaded to github and available on the [release
page](https://github.com/jandelgado/ci-test/releases/)i (TODO).

For demonstration purposes, both a linux- and windows target is created and
For demonstration purposes, a linux, macos and windows target are created and
packetized in a zip-archive.

## Creating a release

On your repositories home (github.com) go to `Releases` > `create release`.
As soon as the release-tag is created, the artifacts will be built and uploaded
to the release page.
When a new release is created, the released-artifacts are automatically
uploaded to github and available on the [releases page](/releases)

## Test coverage (coveralls)

Expand Down
2 changes: 0 additions & 2 deletions pre-commit

This file was deleted.

0 comments on commit 37a8870

Please sign in to comment.