Skip to content

Commit 1ccc74d

Browse files
authored
Merge pull request #52 from johejo/migrate_to_github_actions
Migrate to GitHub Actions
2 parents df1ff59 + 1933833 commit 1ccc74d

File tree

5 files changed

+34
-33
lines changed

5 files changed

+34
-33
lines changed

.github/workflows/test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [windows-latest, macos-latest, ubuntu-latest]
14+
go: ["1.15", "1.16"]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-go@v2
19+
with:
20+
go-version: ${{ matrix.go }}
21+
22+
- run: go generate ./...
23+
- run: git diff --cached --exit-code
24+
- run: go test ./... -v -cover -coverprofile coverage.out
25+
- run: go test -bench . -benchmem
26+
27+
- uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
go-runewidth
22
============
33

4-
[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth)
4+
[![Build Status](https://github.com/mattn/go-runewidth/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-runewidth/actions?query=workflow%3Atest)
55
[![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth)
66
[![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth)

benchmark_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var benchSink int
1212
//
1313

1414
func benchRuneWidth(b *testing.B, eastAsianWidth bool, start, stop rune, want int) int {
15+
b.Helper()
1516
n := 0
1617
got := -1
1718
c := NewCondition()
@@ -29,13 +30,13 @@ func benchRuneWidth(b *testing.B, eastAsianWidth bool, start, stop rune, want in
2930
return n
3031
}
3132
func BenchmarkRuneWidthAll(b *testing.B) {
32-
benchSink = benchRuneWidth(b, false, 0, utf8.MaxRune+1, 1293932)
33+
benchSink = benchRuneWidth(b, false, 0, utf8.MaxRune+1, 1293942)
3334
}
3435
func BenchmarkRuneWidth768(b *testing.B) {
3536
benchSink = benchRuneWidth(b, false, 0, 0x300, 702)
3637
}
3738
func BenchmarkRuneWidthAllEastAsian(b *testing.B) {
38-
benchSink = benchRuneWidth(b, true, 0, utf8.MaxRune+1, 1432558)
39+
benchSink = benchRuneWidth(b, true, 0, utf8.MaxRune+1, 1432568)
3940
}
4041
func BenchmarkRuneWidth768EastAsian(b *testing.B) {
4142
benchSink = benchRuneWidth(b, true, 0, 0x300, 794)
@@ -46,6 +47,7 @@ func BenchmarkRuneWidth768EastAsian(b *testing.B) {
4647
//
4748

4849
func benchString1Width(b *testing.B, eastAsianWidth bool, start, stop rune, want int) int {
50+
b.Helper()
4951
n := 0
5052
got := -1
5153
c := NewCondition()
@@ -64,13 +66,13 @@ func benchString1Width(b *testing.B, eastAsianWidth bool, start, stop rune, want
6466
return n
6567
}
6668
func BenchmarkString1WidthAll(b *testing.B) {
67-
benchSink = benchString1Width(b, false, 0, utf8.MaxRune+1, 1295980)
69+
benchSink = benchString1Width(b, false, 0, utf8.MaxRune+1, 1295990)
6870
}
6971
func BenchmarkString1Width768(b *testing.B) {
7072
benchSink = benchString1Width(b, false, 0, 0x300, 702)
7173
}
7274
func BenchmarkString1WidthAllEastAsian(b *testing.B) {
73-
benchSink = benchString1Width(b, true, 0, utf8.MaxRune+1, 1436654)
75+
benchSink = benchString1Width(b, true, 0, utf8.MaxRune+1, 1436664)
7476
}
7577
func BenchmarkString1Width768EastAsian(b *testing.B) {
7678
benchSink = benchString1Width(b, true, 0, 0x300, 794)

go.test.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)