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 Github actions #448

Merged
merged 15 commits into from Dec 14, 2021
Merged
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,58 @@
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 sendgrid-go
uses: actions/checkout@v2

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

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

- name: Build sendgrid-go
run: make install
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved

- name: Run Tests
run: make test-docker

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
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -51,7 +51,7 @@ We welcome direct contributions to the sendgrid-go code base. Thank you!

##### Prerequisites #####

- Go 1.6
- Go version 1.14, 1.15 or 1.16
- [rest](https://github.com/sendgrid/rest)

##### Initial setup: #####
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
@@ -1,7 +1,6 @@
ARG version=latest
FROM golang:$version

ENV GODEBUG 'x509ignoreCN=0'
ENV GO111MODULE 'off'

COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
Expand Down
5 changes: 4 additions & 1 deletion README.md
@@ -1,6 +1,6 @@
![Twilio SendGrid Logo](twilio_sendgrid_logo.png)

[![BuildStatus](https://travis-ci.com/sendgrid/sendgrid-go.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-go)
[![BuildStatus](https://github.com/sendgrid/sendgrid-go/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/sendgrid-go/actions/workflows/test.yml)
[![GoDoc](https://godoc.org/github.com/sendgrid/sendgrid-go?status.svg)](https://godoc.org/github.com/sendgrid/sendgrid-go)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
Expand Down Expand Up @@ -37,6 +37,9 @@ We appreciate your continued support, thank you!
<a name="installation"></a>
# Installation

## Supported Versions
- Go version 1.14, 1.15 or 1.16
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites

- Go version 1.14, 1.15 or 1.16
Expand Down
6 changes: 3 additions & 3 deletions sendgrid_test.go
Expand Up @@ -30,7 +30,7 @@ func TestRepoFiles(t *testing.T) {
"Dockerfile",
".env_sample",
".gitignore",
".travis.yml",
".github/workflows/test.yml",
// ".codeclimate.yml", // TODO: uncomment this file
"CHANGELOG.md",
"CODE_OF_CONDUCT.md",
Expand Down Expand Up @@ -2735,7 +2735,7 @@ func Test_test_suppression_invalid_emails__email__delete(t *testing.T) {
}

func Test_test_suppression_spam_report__email__get(t *testing.T) {
request := getRequest("/v3/suppression/spam_report/{email}")
request := getRequest("/v3/suppression/spam_reports/{email}")
request.Method = "GET"
request.Headers["X-Mock"] = "200"
response, err := MakeRequest(request)
Expand All @@ -2746,7 +2746,7 @@ func Test_test_suppression_spam_report__email__get(t *testing.T) {
}

func Test_test_suppression_spam_report__email__delete(t *testing.T) {
request := getRequest("/v3/suppression/spam_report/{email}")
request := getRequest("/v3/suppression/spam_reports/{email}")
request.Method = "DELETE"
request.Headers["X-Mock"] = "204"
response, err := MakeRequest(request)
Expand Down