Skip to content

Commit eadf666

Browse files
authored
Add GitHub Actions workflows (#135)
Add test and lint workflows, and remove .travis.yml.
1 parent 1add4dc commit eadf666

File tree

4 files changed

+77
-11
lines changed

4 files changed

+77
-11
lines changed

.github/workflows/lint.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
pull-requests: read
11+
checks: write
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup golang
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: stable
25+
26+
- name: Lint
27+
uses: golangci/golangci-lint-action@v4
28+
with:
29+
only-new-issues: true

.github/workflows/test.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- macos-latest
19+
- windows-latest
20+
go-version:
21+
- "1.13"
22+
- oldstable
23+
- stable
24+
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup golang
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: ${{ matrix.go-version }}
35+
36+
- name: Test
37+
run: go test -race -v
38+
39+
- name: Coverage report
40+
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.go-version == 'stable'
41+
continue-on-error: true
42+
uses: ncruces/go-coverage-report@v0
43+
with:
44+
report: true
45+
chart: true
46+
amend: true

.travis.yml

-9
This file was deleted.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Long lived objects in memory introduce expensive GC overhead, With FreeCache, you can cache unlimited number of objects in memory
44
without increased latency and degraded throughput.
55

6-
[![Build Status](https://travis-ci.org/coocood/freecache.png?branch=master)](https://travis-ci.org/coocood/freecache)
7-
[![GoCover](http://gocover.io/_badge/github.com/coocood/freecache)](http://gocover.io/github.com/coocood/freecache)
6+
[![Build Status](https://github.com/coocood/freecache/workflows/Test/badge.svg)](https://github.com/coocood/freecache/actions/workflows/test.yml)
7+
[![GoCover](http://github.com/coocood/freecache/wiki/coverage.svg)](https://raw.githack.com/wiki/coocood/freecache/coverage.html)
88
[![GoDoc](https://godoc.org/github.com/coocood/freecache?status.svg)](https://godoc.org/github.com/coocood/freecache)
99

1010
## Features

0 commit comments

Comments
 (0)