Skip to content

Commit

Permalink
chore: migrate to Github actions (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferMah authored Jan 25, 2022
1 parent bfe41f9 commit 55b9320
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 39 deletions.
11 changes: 0 additions & 11 deletions .codeclimate.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
schedule:
# Run automatically at 8AM PST Monday-Friday
- cron: '0 15 * * 1-5'
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4]
steps:
- name: Login to Docker Hub
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_AUTH_TOKEN }}

- uses: actions/checkout@v2
- name: Run Unit Tests
run: make test-docker version=${{ matrix.php }}

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: failure
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{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
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![SendGrid Logo](twilio_sendgrid_logo.png)

[![BuildStatus](https://travis-ci.com/sendgrid/sendgrid-php.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-php)
[![Tests](https://github.com/sendgrid/sendgrid-php/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/sendgrid-php/actions/workflows/test-and-deploy.yml)
[![Packagist](https://img.shields.io/packagist/v/sendgrid/sendgrid.svg)](https://packagist.org/packages/sendgrid/sendgrid)
[![Downloads](https://img.shields.io/packagist/dt/sendgrid/sendgrid.svg?maxAge=3600)](https://packagist.org/packages/sendgrid/sendgrid)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
Expand Down
3 changes: 1 addition & 2 deletions test/unit/FilesExistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ class FilesExistTest extends TestCase
public function testFilesArePresentInRepo()
{
$rootDir = __DIR__ . '/../..';
$this->assertFileExists("$rootDir/.codeclimate.yml");
$this->assertFileExists("$rootDir/.env.sample");
$this->assertFileExists("$rootDir/ISSUE_TEMPLATE.md");
$this->assertFileExists("$rootDir/PULL_REQUEST_TEMPLATE.md");
$this->assertFileExists("$rootDir/.gitignore");
$this->assertFileExists("$rootDir/.travis.yml");
$this->assertFileExists("$rootDir/.github/workflows/test-and-deploy.yml");
$this->assertFileExists("$rootDir/CHANGELOG.md");
$this->assertFileExists("$rootDir/CODE_OF_CONDUCT.md");
$this->assertFileExists("$rootDir/LICENSE");
Expand Down

0 comments on commit 55b9320

Please sign in to comment.