From a1dfef907b948b47fe8387d5ffaa475f3c9d4231 Mon Sep 17 00:00:00 2001 From: Nick Snyder Date: Mon, 28 Sep 2020 13:17:55 -0700 Subject: [PATCH] Build with GitHub actions (#224) --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ .travis.yml | 22 -------------------- README.md | 2 +- v2/go.mod | 4 ++-- v2/i18n/bundle.go | 2 +- 5 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c3cf9ff0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build +on: + - push +jobs: + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.15.2 + - name: Git checkout + uses: actions/checkout@v2 + - name: Build and test + working-directory: v2 + run: | + go get -t ./... + go test -race -coverprofile=coverage.txt -covermode=atomic ./... + - name: Upload coverage + uses: codecov/codecov-action@v1 + build_1_9_7: + runs-on: ubuntu-latest + name: Build with Go 1.9.7 + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.9.7 + - name: Git checkout + uses: actions/checkout@v2 + with: + path: gopath/src/github.com/nicksnyder/go-i18n + - name: Build and test + working-directory: gopath/src/github.com/nicksnyder/go-i18n/v2 + env: + GOPATH: ${{ github.workspace }}/gopath + run: | + go get -t ./... + go test -race ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 32cc1034..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go - -matrix: - include: - - go: 1.9.x - env: GO111MODULE=on - - go: 1.x - env: GO111MODULE=on LATEST=true COVER='-coverprofile=coverage.txt -covermode=atomic' - -script: - - cd v2; go test -race $COVER ./... - -after_success: - - bash <(curl -s https://codecov.io/bash) - -deploy: -- provider: script - skip_cleanup: true - script: rm ../go.mod; curl -sL https://git.io/goreleaser | bash - on: - tags: true - condition: $LATEST = true diff --git a/README.md b/README.md index 2d851a02..fa56cc7f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# go-i18n [![Build Status](https://travis-ci.org/nicksnyder/go-i18n.svg?branch=master)](http://travis-ci.org/nicksnyder/go-i18n) [![Report card](https://goreportcard.com/badge/github.com/nicksnyder/go-i18n)](https://goreportcard.com/report/github.com/nicksnyder/go-i18n) [![codecov](https://codecov.io/gh/nicksnyder/go-i18n/branch/master/graph/badge.svg)](https://codecov.io/gh/nicksnyder/go-i18n) [![Sourcegraph](https://sourcegraph.com/github.com/nicksnyder/go-i18n/-/badge.svg)](https://sourcegraph.com/github.com/nicksnyder/go-i18n?badge) +# go-i18n ![Build status](https://github.com/nicksnyder/go-i18n/workflows/Build/badge.svg) [![Report card](https://goreportcard.com/badge/github.com/nicksnyder/go-i18n)](https://goreportcard.com/report/github.com/nicksnyder/go-i18n) [![codecov](https://codecov.io/gh/nicksnyder/go-i18n/branch/master/graph/badge.svg)](https://codecov.io/gh/nicksnyder/go-i18n) [![Sourcegraph](https://sourcegraph.com/github.com/nicksnyder/go-i18n/-/badge.svg)](https://sourcegraph.com/github.com/nicksnyder/go-i18n?badge) go-i18n is a Go [package](#package-i18n) and a [command](#command-goi18n) that helps you translate Go programs into multiple languages. diff --git a/v2/go.mod b/v2/go.mod index 4b27a8e0..bd92c7c4 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -1,5 +1,7 @@ module github.com/nicksnyder/go-i18n/v2 +go 1.9 + require ( github.com/BurntSushi/toml v0.3.0 golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284 // indirect @@ -9,5 +11,3 @@ require ( golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c // indirect gopkg.in/yaml.v2 v2.2.1 ) - -go 1.9 diff --git a/v2/i18n/bundle.go b/v2/i18n/bundle.go index 62bcd435..6c6f5ce4 100644 --- a/v2/i18n/bundle.go +++ b/v2/i18n/bundle.go @@ -26,7 +26,7 @@ type Bundle struct { matcher language.Matcher } -// artTag is the language tag used for artifical languages +// artTag is the language tag used for artificial languages // https://en.wikipedia.org/wiki/Codes_for_constructed_languages var artTag = language.MustParse("art")