Skip to content
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

chore: migrate to gh actions #106

Merged
merged 18 commits into from Dec 14, 2021
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,54 @@
name: Run Tests
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
schedule:
# Run automatically at 8AM PST Monday-Friday
- cron: '0 15 * * 1-5'
workflow_dispatch:

jobs:
tests:
name: Build & Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
go: [ '1.14', '1.15', '1.16' ]
steps:
- name: Checkout rest
uses: actions/checkout@v2

- name: Setup Go environment
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Set Go env vars
run: |
echo "GOPATH=$HOME" >> $GITHUB_ENV
echo "GOBIN=$HOME/bin" >> $GITHUB_ENV
echo "GO111MODULE=off" >> $GITHUB_ENV

- name: Run Tests
run: make test

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: [ tests ]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: 'failure'
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Build Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -45,9 +45,9 @@ We welcome direct contributions to the rest code base. Thank you!

#### Install and Run Locally ####

##### Prerequisites #####
##### Supported Versions #####

- Go version 1.6
- Go version 1.14, 1.15 or 1.16

##### Initial setup: #####

Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
![SendGrid Logo](twilio_sendgrid_logo.png)

[![Build Status](https://travis-ci.com/sendgrid/rest.svg?branch=main)](https://travis-ci.com/sendgrid/rest)
[![BuildStatus](https://github.com/sendgrid/rest/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/rest/actions/workflows/test.yml)
[![GoDoc](https://godoc.org/github.com/sendgrid/rest?status.png)](http://godoc.org/github.com/sendgrid/rest)
[![Go Report Card](https://goreportcard.com/badge/github.com/sendgrid/rest)](https://goreportcard.com/report/github.com/sendgrid/rest)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
Expand All @@ -27,7 +27,7 @@ All updates to this library is documented in our [CHANGELOG](CHANGELOG.md).
<a name="installation"></a>
# Installation

## Prerequisites
## Supported Versions

- Go version 1.14, 1.15 or 1.16

Expand Down
2 changes: 1 addition & 1 deletion rest_test.go
Expand Up @@ -310,7 +310,7 @@ func TestRestError(t *testing.T) {
}

func TestRepoFiles(t *testing.T) {
files := []string{".env_sample", ".gitignore", ".travis.yml", "CHANGELOG.md",
files := []string{".env_sample", ".gitignore", ".github/workflows/test.yml", "CHANGELOG.md",
"CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "ISSUE_TEMPLATE.md",
"LICENSE", "PULL_REQUEST_TEMPLATE.md", "README.md",
"TROUBLESHOOTING.md", "USAGE.md"}
Expand Down