Skip to content

Commit

Permalink
Add GitHub Actions workflows (#135)
Browse files Browse the repository at this point in the history
Add test and lint workflows, and remove .travis.yml.
  • Loading branch information
ichizok authored Apr 12, 2024
1 parent 1add4dc commit eadf666
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 11 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint
on:
push:
branches:
- "**"
pull_request:

permissions:
contents: read
pull-requests: read
checks: write

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup golang
uses: actions/setup-go@v5
with:
go-version: stable

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
only-new-issues: true
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
push:
branches:
- "**"
pull_request:

permissions:
contents: write

jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
go-version:
- "1.13"
- oldstable
- stable

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup golang
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: go test -race -v

- name: Coverage report
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.go-version == 'stable'
continue-on-error: true
uses: ncruces/go-coverage-report@v0
with:
report: true
chart: true
amend: true
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Long lived objects in memory introduce expensive GC overhead, With FreeCache, you can cache unlimited number of objects in memory
without increased latency and degraded throughput.

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

## Features
Expand Down

0 comments on commit eadf666

Please # to comment.