ci: replaced travis with Github action

This commit is contained in:
esimov
2022-03-06 10:53:21 +02:00
parent 9873734204
commit 8ed6bda79c
2 changed files with 44 additions and 23 deletions

44
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
go-version: [~1.13, ~1.14, ~1.15, ~1.16, ~1.17]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: "on"
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v2
- name: Download Go modules
run: go mod download
- name: Install project
run: go install

View File

@@ -1,23 +0,0 @@
language: go
branches:
only:
- "master"
# In theory, older versions would probably work just fine
go:
- 1.8
- 1.9
env:
- GOOS=linux
- GOOS=darwin
- GOOS=windows
script:
- go get -u -t ./...
notifications:
email:
on_success: never
on_failure: never