forked from syntaxerrors/Steam
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.97 KB
/
Copy pathphp.yml
File metadata and controls
62 lines (53 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Unit Tests
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
env:
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
strategy:
fail-fast: false
matrix:
php: ["8.2", "8.3", "8.4", "8.5"]
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, simplexml, libxml, curl, json, sodium
coverage: pcov
- name: PHP ${{ matrix.php }} - Validate composer.json and composer.lock
run: composer validate --strict --no-check-publish
- name: PHP ${{ matrix.php }} - Resolve compatible dependencies
run: composer update --no-interaction --prefer-dist
- name: PHP ${{ matrix.php }} - Run offline test suite
run: vendor/bin/phpunit --filter "AppListTest|ClientConstructionTest|CommunityInventoryTest|CurrentApiEndpointsTest|UserStatsResponseTest|LaravelClientBindingTest"
- name: PHP ${{ matrix.php }} - Run full test suite
if: env.STEAM_API_KEY != ''
run: composer run-script test
- name: Publish Test Coverage
uses: paambaati/codeclimate-action@v6
if: matrix.php == '8.4' && github.ref == 'refs/heads/master' && env.STEAM_API_KEY != ''
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
XDEBUG_MODE: coverage
with:
coverageCommand: composer run-script coverage
coverageLocations: ${{github.workspace}}/coverage.clover:clover
debug: true
- uses: sarisia/actions-status-discord@v1
if: failure() && env.DISCORD_WEBHOOK != ''
with:
status: ${{ job.status }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "${{ matrix.php }}: Tests failed."
color: "red"