Skip to content

Commit

Permalink
Switch to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Mar 28, 2022
1 parent e53b349 commit 7d48594
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 105 deletions.
27 changes: 0 additions & 27 deletions .circleci/check-coverage

This file was deleted.

8 changes: 0 additions & 8 deletions .circleci/check-gofmt

This file was deleted.

25 changes: 0 additions & 25 deletions .circleci/check-testfiles

This file was deleted.

43 changes: 0 additions & 43 deletions .circleci/config.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test, Lint

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17]

steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2

- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Run tests
run: make test

- uses: codecov/codecov-action@v2
with:
file: coverage.out

lint:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17]

steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2

- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-cache: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ _testmain.go
webroot
/config.toml
/vendor
/bin
/bin
coverage.html
coverage.out
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

## testing

.PHONY: coverage.out
coverage.out:
go test -race -covermode=atomic -coverprofile=$@ ./...

coverage.html: coverage.out
go tool cover -html $< -o $@

.PHONY: test
test: coverage.out ## runs tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __ __ _
Yet another node info collector
```

[![CircleCI](https://circleci.com/gh/FreifunkBremen/yanic/tree/main.svg?style=shield)](https://circleci.com/gh/FreifunkBremen/yanic/tree/main)
[![Test, Lint](https://github.com/FreifunkBremen/yanic/actions/workflows/go.yml/badge.svg)](https://github.com/FreifunkBremen/yanic/actions/workflows/go.yml)
[![Coverage Status](https://coveralls.io/repos/github/FreifunkBremen/yanic/badge.svg?branch=main)](https://coveralls.io/github/FreifunkBremen/yanic?branch=main)
[![codecov](https://codecov.io/gh/FreifunkBremen/yanic/branch/main/graph/badge.svg)](https://codecov.io/gh/FreifunkBremen/yanic)
[![Go Report Card](https://goreportcard.com/badge/github.com/FreifunkBremen/yanic)](https://goreportcard.com/report/github.com/FreifunkBremen/yanic)
Expand Down

0 comments on commit 7d48594

Please sign in to comment.