Skip to content

Commit e5129e6

Browse files
authored
chore: migrate to GitHub Actions (#104)
1 parent 46b0bdc commit e5129e6

File tree

5 files changed

+89
-27
lines changed

5 files changed

+89
-27
lines changed

.github/workflows/release.yml

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

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup .NET Core SDK
23+
uses: actions/[email protected]
24+
with:
25+
dotnet-version: '3.1.x'
26+
27+
- name: Build & Test
28+
run: make test
29+
- run: bash <(curl -s https://codecov.io/bash)
30+
31+
notify-on-failure:
32+
name: Slack notify on failure
33+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
34+
needs: [ tests ]
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: rtCamp/action-slack-notify@v2
38+
env:
39+
SLACK_COLOR: 'danger'
40+
SLACK_ICON_EMOJI: ':github:'
41+
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
42+
SLACK_TITLE: Build Failure
43+
SLACK_USERNAME: GitHub Actions
44+
SLACK_MSG_AUTHOR: twilio-dx
45+
SLACK_FOOTER: Posted automatically using GitHub Actions
46+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
47+
MSG_MINIMAL: true

.travis.yml

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

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-
[![Travis Badge](https://travis-ci.com/sendgrid/csharp-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/csharp-http-client)
3+
[![BuildStatus](https://github.com/sendgrid/csharp-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/csharp-http-client/actions/workflows/test.yml)
44
[![NuGet](https://img.shields.io/nuget/v/SendGrid.CSharp.Http.Client.svg)](https://www.nuget.org/packages/SendGrid.CSharp.HTTP.Client)
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)

UnitTest/RequiredFilesExistTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public void checkGitIgnoreExists() {
2727
Assert.True(File.Exists("./.gitignore"));
2828
}
2929

30-
// ./.travis.yml
31-
public void checkTravisExists() {
32-
Assert.True(File.Exists("./.travis.yml"));
33-
}
34-
3530
// ./.codeclimate.yml
3631
public void checkCodeClimateExists() {
3732
Assert.True(File.Exists("./.codeclimate.yml"));

0 commit comments

Comments
 (0)