Skip to content

Commit

Permalink
chore: migrate to Github actions (#448)
Browse files Browse the repository at this point in the history
* chore: migrate to github actions
  • Loading branch information
Bilal Boussayoud committed Dec 14, 2021
1 parent 662f388 commit e55a425
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 27 deletions.
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 sendgrid-go
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-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
6 changes: 4 additions & 2 deletions 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,9 +37,11 @@ We appreciate your continued support, thank you!
<a name="installation"></a>
# Installation

## Supported Versions
- Go version 1.14, 1.15 or 1.16

## Prerequisites

- Go version 1.14, 1.15 or 1.16
- The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-go), to send up to 40,000 emails for the first 30 days, then send 100 emails/day free forever or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-go).

## Setup Environment Variables
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

0 comments on commit e55a425

Please sign in to comment.