Skip to content

Migrate to GitHub Actions #1473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/echo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
GO111MODULE: on
GOPROXY: https://proxy.golang.org

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: [1.11, 1.12, 1.13]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Set GOPATH and PATH
run: |
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash

- name: Checkout Code
uses: actions/checkout@v1
with:
ref: ${{ github.ref }}

- name: Install Dependencies
run: go get -v golang.org/x/lint/golint

- name: Run Tests
run: |
golint -set_exit_status ./...
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...

- name: Upload coverage to Codecov
if: success() && matrix.go == 1.13 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token:
fail_ci_if_error: false