Skip to content

Commit 6169c51

Browse files
authored
chore: migrate to GitHub Actions (#1142)
1 parent b7cb4f0 commit 6169c51

File tree

8 files changed

+94
-48
lines changed

8 files changed

+94
-48
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout sendgrid-csharp
14+
uses: actions/checkout@v2
15+
16+
- name: Setup .NET Core SDK
17+
uses: actions/[email protected]
18+
with:
19+
dotnet-version: '3.1.x'
20+
21+
- name: Publish package to NuGet
22+
run: |
23+
make release
24+
dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
25+
26+
notify-on-failure:
27+
name: Slack notify on failure
28+
if: ${{ failure() }}
29+
needs: [ release ]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: rtCamp/action-slack-notify@v2
33+
env:
34+
SLACK_COLOR: 'danger'
35+
SLACK_ICON_EMOJI: ':github:'
36+
SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
37+
SLACK_TITLE: Release Failure
38+
SLACK_USERNAME: GitHub Actions
39+
SLACK_MSG_AUTHOR: twilio-dx
40+
SLACK_FOOTER: Posted automatically using GitHub Actions
41+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
42+
MSG_MINIMAL: true

.github/workflows/test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [ '*' ]
5+
pull_request:
6+
branches: [ main ]
7+
schedule:
8+
# Run automatically at 8AM PST Monday-Friday
9+
- cron: '0 15 * * 1-5'
10+
workflow_dispatch:
11+
12+
jobs:
13+
tests:
14+
name: Run Tests
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 20
17+
steps:
18+
- name: Checkout sendgrid-csharp
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup .NET Core SDK
24+
uses: actions/[email protected]
25+
with:
26+
dotnet-version: '3.1.x'
27+
28+
- run: dotnet build -c Release
29+
- name: Build & Test
30+
run: make test-docker release
31+
- run: bash <(curl -s https://codecov.io/bash)
32+
33+
notify-on-failure:
34+
name: Slack notify on failure
35+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
36+
needs: [ tests ]
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: rtCamp/action-slack-notify@v2
40+
env:
41+
SLACK_COLOR: 'danger'
42+
SLACK_ICON_EMOJI: ':github:'
43+
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
44+
SLACK_TITLE: Build Failure
45+
SLACK_USERNAME: GitHub Actions
46+
SLACK_MSG_AUTHOR: twilio-dx
47+
SLACK_FOOTER: Posted automatically using GitHub Actions
48+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
49+
MSG_MINIMAL: true

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ RUN apt-get update \
1414
COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
1515
RUN update-ca-certificates
1616

17-
WORKDIR /app
1817
COPY . .
1918

2019
RUN make install

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![SendGrid Logo](twilio_sendgrid_logo.png)
22

3-
[![BuildStatus](https://travis-ci.com/sendgrid/sendgrid-csharp.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-csharp)
3+
[![BuildStatus](https://github.com/sendgrid/sendgrid-csharp/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/sendgrid-csharp/actions/workflows/test.yml)
44
[![NuGet](https://img.shields.io/nuget/v/SendGrid.svg)](https://www.nuget.org/packages/SendGrid)
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
66
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)

SendGrid.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2626
.editorconfig = .editorconfig
2727
.env_sample = .env_sample
2828
.gitignore = .gitignore
29-
.travis.yml = .travis.yml
3029
CHANGELOG.md = CHANGELOG.md
3130
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
3231
CONTRIBUTING.md = CONTRIBUTING.md

tests/SendGrid.Tests/Integration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4928,7 +4928,7 @@ public async Task TestSuppressionSpamReportEmailGet()
49284928
{
49294929
var sg = GetClient("200");
49304930
var email = "test_url_param";
4931-
var response = await sg.RequestAsync(method: SendGridClient.Method.GET, urlPath: "suppression/spam_report/" + email);
4931+
var response = await sg.RequestAsync(method: SendGridClient.Method.GET, urlPath: "suppression/spam_reports/" + email);
49324932
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
49334933
}
49344934

@@ -4937,7 +4937,7 @@ public async Task TestSuppressionSpamReportEmailDelete()
49374937
{
49384938
var sg = GetClient("204");
49394939
var email = "test_url_param";
4940-
var response = await sg.RequestAsync(method: SendGridClient.Method.DELETE, urlPath: "suppression/spam_report/" + email);
4940+
var response = await sg.RequestAsync(method: SendGridClient.Method.DELETE, urlPath: "suppression/spam_reports/" + email);
49414941
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
49424942
}
49434943

tests/SendGrid.Tests/RequiredFilesExistTest.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ public void checkGitIgnoreExists()
3333
Assert.True(File.Exists("./.gitignore"));
3434
}
3535

36-
// ./.travis.yml
37-
public void checkTravisExists()
38-
{
39-
Assert.True(File.Exists("./.travis.yml"));
40-
}
41-
42-
// ./.codeclimate.yml
43-
public void checkCodeClimateExists()
44-
{
45-
Assert.True(File.Exists("./.codeclimate.yml"));
46-
}
4736

4837
// ./CHANGELOG.md
4938
public void checkChangelogExists()

0 commit comments

Comments
 (0)