Skip to content

Commit 153c496

Browse files
authored
Merge pull request #117 from syntaxerrors/php-8
Bump versions, include PHP 8 support.
2 parents 1ab2478 + 6bba293 commit 153c496

File tree

10 files changed

+1247
-825
lines changed

10 files changed

+1247
-825
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Steam API key for testing
2-
apiKey=
2+
apiKey=
3+
XDEBUG_MODE=coverage

.github/workflows/php.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Steam
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 0 1 * *"
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
matrix:
14+
php: [ '7.3', '7.4', '8.0' ]
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
extensions: bcmath, simplexml, libxml, curl, json
23+
coverage: pcov
24+
25+
- name: PHP ${{ matrix.php }} - Validate composer.json and composer.lock
26+
run: composer validate
27+
28+
- name: PHP ${{ matrix.php }} - Cache Composer packages
29+
id: composer-cache
30+
uses: actions/cache@v2
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-
36+
37+
- name: PHP ${{ matrix.php }} - Install dependencies
38+
if: steps.composer-cache.outputs.cache-hit != 'true'
39+
run: composer install
40+
41+
- name: PHP ${{ matrix.php }} - Run coverage test suite
42+
env:
43+
apiKey: ${{ secrets.STEAM_API_KEY }}
44+
run: composer run-script test
45+
46+
- uses: sarisia/actions-status-discord@v1
47+
if: ${{ failure() }}
48+
with:
49+
status: ${{ job.status }}
50+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
51+
title: "${{ matrix.php }}: Tests failed."
52+
color: 'red'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ocular.phar
66
uploadTests.sh
77
.env
88
.phpunit.*
9+
*.clover

.scrutinizer.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
[![Join the chat at https://gitter.im/syntaxerrors/Steam](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/syntaxerrors/Steam?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

5-
[![Build Status](https://travis-ci.org/syntaxerrors/Steam.svg)](https://travis-ci.org/syntaxerrors/Steam)
6-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/syntaxerrors/Steam/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/syntaxerrors/Steam/?branch=master)
5+
![Steam](https://github.com/syntaxerrors/Steam/workflows/Steam/badge.svg)
6+
[![Maintainability](https://api.codeclimate.com/v1/badges/eb99d8de80e750fd4c27/maintainability)](https://codeclimate.com/github/syntaxerrors/Steam/maintainability)
7+
<a href="https://codeclimate.com/github/syntaxerrors/Steam/test_coverage"><img src="https://api.codeclimate.com/v1/badges/eb99d8de80e750fd4c27/test_coverage" /></a>
78
[![Latest Stable Version](https://poser.pugx.org/syntax/steam-api/v/stable.svg)](https://packagist.org/packages/syntax/steam-api)
89
[![Total Downloads](https://poser.pugx.org/syntax/steam-api/downloads.svg)](https://packagist.org/packages/syntax/steam-api)
910
[![License](https://poser.pugx.org/syntax/steam-api/license.svg)](https://packagist.org/packages/syntax/steam-api)
@@ -397,13 +398,25 @@ group| string or int | The ID or the name of the group. | Yes
397398
398399
## Testing the Steam Package
399400

400-
**Install dependancies**
401-
`docker run -it --rm -v $PWD:/opt/app -w /opt/app --network host --name php nicekiwi/php composer install`
402-
403401
A Steam API key must be provided or most tests will fail.
404402

405403
**Run Tests**
406-
`docker run -it --rm -v $PWD:/opt/app -w /opt/app --network host --name php -e apiKey='YOUR_STEAM_API_KEY' nicekiwi/php ./vendor/bin/phpunit`
404+
```
405+
# Install dependancies
406+
docker-compose run php composer install
407+
408+
# Run tests (assumes apiKey is set in .env file)
409+
docker-compose run php composer test
410+
411+
# Or with the apiKey inline
412+
docker-compose run -e api=YOUR_STEAM_API_KEY php composer test
413+
414+
# With coverage
415+
docker-compose run php composer coverage
416+
417+
# Play around
418+
docker-compose run php bash
419+
```
407420

408421
## Contributors
409422
- [Stygiansabyss](https://github.com/stygiansabyss)

composer.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "syntax/steam-api",
33
"description": "A steam-api client for Laravel 6+",
4-
"version": "2.2.1",
4+
"version": "2.3.0",
55
"license": "MIT",
66
"authors": [
77
{
@@ -10,17 +10,17 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.3",
14-
"laravel/framework": "^6.0|^7.0|^8.0",
15-
"guzzlehttp/guzzle": "^7.0.1",
13+
"php": "^7.3|^8.0",
14+
"laravel/framework": "^6.20.12|^7.30.3|^8.22.1",
15+
"guzzlehttp/guzzle": "^7.0",
1616
"ext-bcmath": "*",
1717
"ext-simplexml": "*",
1818
"ext-libxml": "*",
1919
"ext-curl": "*",
2020
"ext-json": "*"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^9.3",
23+
"phpunit/phpunit": "^9.5",
2424
"orchestra/testbench": "^6.0",
2525
"vlucas/phpdotenv": "^5.2"
2626
},
@@ -36,5 +36,9 @@
3636
]
3737
}
3838
},
39-
"minimum-stability": "stable"
39+
"minimum-stability": "stable",
40+
"scripts": {
41+
"test": "vendor/bin/phpunit",
42+
"coverage": "vendor/bin/phpunit --coverage-clover=coverage.clover"
43+
}
4044
}

0 commit comments

Comments
 (0)