Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "Continuous Integration"

on:
- push
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"

jobs:
tests:
name: "CI"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
dependencies: [highest]
include:
- php-version: "7.1"
dependencies: lowest
- php-version: "8.0"
dependencies: lowest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Unpin PHP version in the platform config
run: 'composer config platform.config.php --unset'

- name: "Handle lowest dependencies update"
if: "contains(matrix.dependencies, 'lowest')"
run: "echo \"COMPOSER_FLAGS=$COMPOSER_FLAGS --prefer-lowest\" >> $GITHUB_ENV"

- name: "Update dependencies"
run: composer update ${{ env.COMPOSER_FLAGS }}

- name: "Run tests"
run: |
vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover --testsuite unit
test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover)
44 changes: 44 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "PHPCS"

on:
- push
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"

jobs:
tests:
name: "CI"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Unpin PHP version in the platform config
run: 'composer config platform.config.php --unset'

- name: "Update dependencies"
run: composer update ${{ env.COMPOSER_FLAGS }}

- name: "Run PHPCS"
run: |
vendor/bin/phpcs -p --warning-severity=0 src/ tests/
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
],
"homepage": "https://github.com/graze/dog-statsd",
"license": "MIT",
"config": {
"platform": {
"php": "7.2"
}
},
"authors": [
{
"name": "Harry Bragg",
Expand All @@ -29,10 +24,10 @@
}
],
"require": {
"php": "^5.5|^7.0"
"php": "^7.1|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7.21|^6|^7",
"phpunit/phpunit": "^7|^8.5",
"squizlabs/php_codesniffer": "^3",
"johnkary/phpunit-speedtrap": "^1|^2|^3",
"graze/standards": "^2"
Expand All @@ -47,5 +42,6 @@
"Graze\\DogStatsD\\Test\\": "tests/src",
"Graze\\DogStatsD\\Test\\Unit\\": "tests/unit"
}
}
},
"lock": false
}
Loading