Skip to content

Commit

Permalink
Added github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed Aug 8, 2023
1 parent d9fd957 commit 60b9d20
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
@@ -1,4 +1,5 @@
#!/bin/sh

if [[ $(go list -m all) =~ ^github.com/asticode/go-astilog[[:space:]]+github.com/asticode/go-astikit[[:space:]]+v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "cheers"
else
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,37 @@
name: Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Check external dependencies
run: |
bash .github/workflows/no_external_dependencies.sh
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go mod download

- name: Run tests
run: go test -race -covermode atomic -coverprofile=covprofile ./...

- if: github.event_name != 'pull_request'
name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
go install github.com/mattn/goveralls@latest
goveralls -coverprofile=covprofile -service=github
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
[![GoReportCard](http://goreportcard.com/badge/github.com/asticode/go-astilog)](http://goreportcard.com/report/github.com/asticode/go-astilog)
[![GoDoc](https://godoc.org/github.com/asticode/go-astilog?status.svg)](https://godoc.org/github.com/asticode/go-astilog)
[![Travis](https://travis-ci.org/asticode/go-astilog.svg?branch=master)](https://travis-ci.org/asticode/go-astilog#)
[![Test](https://github.com/asticode/go-astilog/actions/workflows/test.yml/badge.svg)](https://github.com/asticode/go-astilog/actions/workflows/test.yml)
[![Coveralls](https://coveralls.io/repos/github/asticode/go-astilog/badge.svg?branch=master)](https://coveralls.io/github/asticode/go-astilog)

`astilog` goal is to provide an implementation of [astilog.CompleteLogger](https://github.com/asticode/go-astilog/blob/master/logger.go#L8) interface while restricting dependencies to [astilog](https://github.com/asticode/go-astilog) only.
Expand Down
2 changes: 1 addition & 1 deletion logger.go
Expand Up @@ -126,7 +126,7 @@ func source() string {
// Skip self callers
i := 0
_, file, line, ok := runtime.Caller(i)
for ok && strings.Contains(file, "asticode/go-astilog/logger.go") {
for ok && strings.Contains(file, "/go-astilog/logger.go") {
i++
_, file, line, ok = runtime.Caller(i)
}
Expand Down

0 comments on commit 60b9d20

Please sign in to comment.