Skip to content

Bump versions, include PHP 8 support. #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jan 23, 2021
Merged
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Steam API key for testing
apiKey=
apiKey=
XDEBUG_MODE=coverage
52 changes: 52 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Steam

on:
push:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '7.3', '7.4', '8.0' ]
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, simplexml, libxml, curl, json
coverage: pcov

- name: PHP ${{ matrix.php }} - Validate composer.json and composer.lock
run: composer validate

- name: PHP ${{ matrix.php }} - Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: PHP ${{ matrix.php }} - Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install

- name: PHP ${{ matrix.php }} - Run coverage test suite
env:
apiKey: ${{ secrets.STEAM_API_KEY }}
run: composer run-script test

- uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
status: ${{ job.status }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "${{ matrix.php }}: Tests failed."
color: 'red'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ocular.phar
uploadTests.sh
.env
.phpunit.*
*.clover
4 changes: 0 additions & 4 deletions .scrutinizer.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

[![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)

[![Build Status](https://travis-ci.org/syntaxerrors/Steam.svg)](https://travis-ci.org/syntaxerrors/Steam)
[![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)
![Steam](https://github.com/syntaxerrors/Steam/workflows/Steam/badge.svg)
[![Maintainability](https://api.codeclimate.com/v1/badges/eb99d8de80e750fd4c27/maintainability)](https://codeclimate.com/github/syntaxerrors/Steam/maintainability)
<a href="https://codeclimate.com/github/syntaxerrors/Steam/test_coverage"><img src="https://api.codeclimate.com/v1/badges/eb99d8de80e750fd4c27/test_coverage" /></a>
[![Latest Stable Version](https://poser.pugx.org/syntax/steam-api/v/stable.svg)](https://packagist.org/packages/syntax/steam-api)
[![Total Downloads](https://poser.pugx.org/syntax/steam-api/downloads.svg)](https://packagist.org/packages/syntax/steam-api)
[![License](https://poser.pugx.org/syntax/steam-api/license.svg)](https://packagist.org/packages/syntax/steam-api)
Expand Down Expand Up @@ -397,13 +398,25 @@ group| string or int | The ID or the name of the group. | Yes

## Testing the Steam Package

**Install dependancies**
`docker run -it --rm -v $PWD:/opt/app -w /opt/app --network host --name php nicekiwi/php composer install`

A Steam API key must be provided or most tests will fail.

**Run Tests**
`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`
```
# Install dependancies
docker-compose run php composer install

# Run tests (assumes apiKey is set in .env file)
docker-compose run php composer test

# Or with the apiKey inline
docker-compose run -e api=YOUR_STEAM_API_KEY php composer test

# With coverage
docker-compose run php composer coverage

# Play around
docker-compose run php bash
```

## Contributors
- [Stygiansabyss](https://github.com/stygiansabyss)
Expand Down
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "syntax/steam-api",
"description": "A steam-api client for Laravel 6+",
"version": "2.2.1",
"version": "2.3.0",
"license": "MIT",
"authors": [
{
Expand All @@ -10,17 +10,17 @@
}
],
"require": {
"php": "^7.3",
"laravel/framework": "^6.0|^7.0|^8.0",
"guzzlehttp/guzzle": "^7.0.1",
"php": "^7.3|^8.0",
"laravel/framework": "^6.20.12|^7.30.3|^8.22.1",
"guzzlehttp/guzzle": "^7.0",
"ext-bcmath": "*",
"ext-simplexml": "*",
"ext-libxml": "*",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"phpunit/phpunit": "^9.5",
"orchestra/testbench": "^6.0",
"vlucas/phpdotenv": "^5.2"
},
Expand All @@ -36,5 +36,9 @@
]
}
},
"minimum-stability": "stable"
"minimum-stability": "stable",
"scripts": {
"test": "vendor/bin/phpunit",
"coverage": "vendor/bin/phpunit --coverage-clover=coverage.clover"
}
}
Loading