Skip to content

Commit 5b83ac8

Browse files
committed
Merge branch 'master' into develop
2 parents fc67ad0 + 4f4eb15 commit 5b83ac8

12 files changed

Lines changed: 3431 additions & 1118 deletions

File tree

.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: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Unit Tests
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: [ '8.0', '7.4', '7.3' ]
15+
continue-on-error: true
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php }}
23+
extensions: bcmath, simplexml, libxml, curl, json
24+
coverage: pcov
25+
26+
- name: PHP ${{ matrix.php }} - Validate composer.json and composer.lock
27+
run: composer validate
28+
29+
- name: PHP ${{ matrix.php }} - Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v2
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-php-
37+
38+
- name: PHP ${{ matrix.php }} - Install dependencies
39+
if: steps.composer-cache.outputs.cache-hit != 'true'
40+
run: composer install
41+
42+
- name: PHP ${{ matrix.php }} - Run coverage test suite
43+
env:
44+
apiKey: ${{ secrets.STEAM_API_KEY }}
45+
run: composer run-script test
46+
47+
- name: Publish Test Coverage
48+
uses: paambaati/codeclimate-action@v2.7.5
49+
if: ${{ matrix.php }} == '8.0' && ${{ github.ref }} == 'master'
50+
env:
51+
apiKey: ${{ secrets.STEAM_API_KEY }}
52+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
53+
XDEBUG_MODE: coverage
54+
with:
55+
coverageCommand: composer run-script coverage
56+
coverageLocations: ${{github.workspace}}/coverage.clover:clover
57+
debug: true
58+
59+
- uses: sarisia/actions-status-discord@v1
60+
if: ${{ failure() }}
61+
with:
62+
status: ${{ job.status }}
63+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
64+
title: "${{ matrix.php }}: Tests failed."
65+
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 & 25 deletions
This file was deleted.

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# Steam
1+
# Steam API
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+
![Unit Tests](https://github.com/syntaxerrors/Steam/workflows/Unit%20Tests/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)
1011

1112
**Version Support**
12-
`Laravel >= 5.8.0`
13-
`PHP >= 7.2.0`
13+
`Laravel >= 6.0`
14+
`PHP >= 7.3.0`
1415

1516
- [Installation](#installation)
1617
- [Usage](#usage)
@@ -29,7 +30,7 @@ This package provides an easy way to get details from the Steam API service. Th
2930
Begin by installing this package with composer.
3031

3132
"require": {
32-
"syntax/steam-api": "2.1.*"
33+
"syntax/steam-api": "2.3.*"
3334
}
3435

3536
Next, update composer from the terminal.
@@ -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)
@@ -415,3 +428,4 @@ A Steam API key must be provided or most tests will fail.
415428
- [JRizzle88](https://github.com/JRizzle88)
416429
- [jastend](https://github.com/jastend)
417430
- [Teakowa](https://github.com/Teakowa)
431+
- [Ben Sherred](https://github.com/bensherred)

composer.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "syntax/steam-api",
3-
"description": "A steam-api client for Laravel 5.8+",
4-
"version": "2.1.2",
3+
"description": "A steam-api client for Laravel 6+",
4+
"version": "2.3.0",
55
"license": "MIT",
66
"authors": [
77
{
@@ -10,19 +10,19 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.2.0",
14-
"laravel/framework": ">=5.8.0",
15-
"guzzlehttp/guzzle": "^6.0",
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": "^8.0",
24-
"orchestra/testbench": "^3.0",
25-
"vlucas/phpdotenv": "^3.6"
23+
"phpunit/phpunit": "^9.5",
24+
"orchestra/testbench": "^6.0",
25+
"vlucas/phpdotenv": "^5.2"
2626
},
2727
"autoload": {
2828
"psr-4": {
@@ -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)