Skip to content

Commit

Permalink
adds workflow, cleans up composer
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech committed Jul 4, 2024
1 parent c4a37a8 commit 067a230
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PHP Composer

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: composer test

- name: Style check
run: composer php-cs-fixer-check
13 changes: 13 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "cosmastech/statsd-client",
"description": "A StatsD client adapter",
"license": "WTFPL",
"authors": [
{
"name": "Luke Kuzmish",
Expand All @@ -9,16 +11,15 @@
],
"require": {
"php": "^8.2",
"datadog/php-datadogstatsd": "*",
"psr/clock-implementation": "1.0",
"psr/log": "^2.0 || ^3.0"
"datadog/php-datadogstatsd": "^1.6.1",
"psr/clock-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "^11.2.5",
"nesbot/carbon": "^3.6.0",
"friendsofphp/php-cs-fixer": "^3.59",
"league/statsd": "^2.0.0",
"cosmastech/psr-logger-spy": "^0.0.1"
"cosmastech/psr-logger-spy": "^0.0.1",
"psr/log": "3.0.0"
},
"suggest": {
"datadog/php-datadogstatsd": "For DataDog stats",
Expand All @@ -38,6 +39,7 @@
},
"scripts": {
"test": "phpunit tests",
"php-cs-fixer": "./vendor/bin/php-cs-fixer fix ./"
"php-cs-fixer": "./vendor/bin/php-cs-fixer fix ./",
"php-cs-fixer-check": "./vendor/bin/php-cs-fixer check ./"
}
}

0 comments on commit 067a230

Please sign in to comment.