Skip to content

Commit ad7404b

Browse files
authored
chore: migrate to Github actions (#149)
1 parent 457bfeb commit ad7404b

File tree

5 files changed

+66
-61
lines changed

5 files changed

+66
-61
lines changed

.codeclimate.yml

-18
This file was deleted.

.github/workflows/test-and-deploy.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Test
2+
on:
3+
push:
4+
branches: [ '*' ]
5+
tags: [ '*' ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
# Run automatically at 8AM PST Monday-Friday
10+
- cron: '0 15 * * 1-5'
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 20
18+
strategy:
19+
matrix:
20+
php: [ 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 ]
21+
dependencies:
22+
- "lowest"
23+
- "highest"
24+
25+
steps:
26+
- name: Checkout php-http-client
27+
uses: actions/checkout@v2
28+
29+
- name: Setup PHP Action
30+
uses: shivammathur/[email protected]
31+
with:
32+
php-version: ${{ matrix.php }}
33+
id: php
34+
35+
- name: Composer webhook config
36+
run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Install dependencies
39+
run: composer install
40+
41+
- name: Update Dependencies
42+
if: ${{ matrix.dependencies == 'lowest' }}
43+
run: composer update --prefer-lowest --prefer-stable -n
44+
45+
- name: Run Tests
46+
run: make test
47+
48+
notify-on-failure:
49+
name: Slack notify on failure
50+
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
51+
needs: [test]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: rtCamp/action-slack-notify@v2
55+
env:
56+
SLACK_COLOR: failure
57+
SLACK_ICON_EMOJI: ':github:'
58+
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
59+
SLACK_TITLE: Build Failure
60+
SLACK_USERNAME: GitHub Actions
61+
SLACK_MSG_AUTHOR: twilio-dx
62+
SLACK_FOOTER: Posted automatically using GitHub Actions
63+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
64+
MSG_MINIMAL: true

.travis.yml

-35
This file was deleted.

README.md

+1-1
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/php-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/php-http-client)
3+
[![Tests](https://github.com/sendgrid/php-http-client/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/php-http-client/actions/workflows/test-and-deploy.yml)
44
[![Latest Version on Packagist](https://img.shields.io/packagist/v/sendgrid/php-http-client.svg?style=flat-square)](https://packagist.org/packages/sendgrid/php-http-client)
55
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
66
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/php-http-client.svg)](https://github.com/sendgrid/php-http-client/graphs/contributors)

test/unit/FilesExistTest.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ public function testFileArePresentInRepo()
1111
$rootDir = __DIR__ . '/../..';
1212

1313
$this->assertFileExists("$rootDir/.gitignore");
14-
#$this->assertFileExists("$rootDir/.env_sample");
15-
$this->assertFileExists("$rootDir/.travis.yml");
16-
$this->assertFileExists("$rootDir/.codeclimate.yml");
14+
$this->assertFileExists("$rootDir/.github/workflows/test-and-deploy.yml");
1715
$this->assertFileExists("$rootDir/CHANGELOG.md");
1816
$this->assertFileExists("$rootDir/CODE_OF_CONDUCT.md");
1917
$this->assertFileExists("$rootDir/CONTRIBUTING.md");
@@ -24,9 +22,5 @@ public function testFileArePresentInRepo()
2422
$this->assertFileExists("$rootDir/README.md");
2523
$this->assertFileExists("$rootDir/TROUBLESHOOTING.md");
2624
$this->assertFileExists("$rootDir/USAGE.md");
27-
#$this->assertFileExists("$rootDir/USE_CASES.md");
28-
29-
#$composeExists = file_exists('./docker-compose.yml') || file_exists('./docker/docker-compose.yml');
30-
#$this->assertTrue($composeExists);
3125
}
3226
}

0 commit comments

Comments
 (0)