Skip to content

Commit

Permalink
chore: migrate to Github actions (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferMah authored Jan 25, 2022
1 parent 457bfeb commit ad7404b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 61 deletions.
18 changes: 0 additions & 18 deletions .codeclimate.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test
on:
push:
branches: [ '*' ]
tags: [ '*' ]
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 ]
dependencies:
- "lowest"
- "highest"

steps:
- name: Checkout php-http-client
uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
id: php

- name: Composer webhook config
run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer install

- name: Update Dependencies
if: ${{ matrix.dependencies == 'lowest' }}
run: composer update --prefer-lowest --prefer-stable -n

- name: Run Tests
run: make test

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
35 changes: 0 additions & 35 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)

[![Travis Badge](https://travis-ci.com/sendgrid/php-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/php-http-client)
[![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)
[![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)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/php-http-client.svg)](https://github.com/sendgrid/php-http-client/graphs/contributors)
Expand Down
8 changes: 1 addition & 7 deletions test/unit/FilesExistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ public function testFileArePresentInRepo()
$rootDir = __DIR__ . '/../..';

$this->assertFileExists("$rootDir/.gitignore");
#$this->assertFileExists("$rootDir/.env_sample");
$this->assertFileExists("$rootDir/.travis.yml");
$this->assertFileExists("$rootDir/.codeclimate.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/CONTRIBUTING.md");
Expand All @@ -24,9 +22,5 @@ public function testFileArePresentInRepo()
$this->assertFileExists("$rootDir/README.md");
$this->assertFileExists("$rootDir/TROUBLESHOOTING.md");
$this->assertFileExists("$rootDir/USAGE.md");
#$this->assertFileExists("$rootDir/USE_CASES.md");

#$composeExists = file_exists('./docker-compose.yml') || file_exists('./docker/docker-compose.yml');
#$this->assertTrue($composeExists);
}
}

0 comments on commit ad7404b

Please sign in to comment.