Skip to content

Commit 07086ac

Browse files
committed
New: Added GitHub Actions workflow
1 parent f9df9d6 commit 07086ac

File tree

6 files changed

+132
-15
lines changed

6 files changed

+132
-15
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/tests export-ignore
22
.editorconfig export-ignore
33
.gitattributes export-ignore
4+
.github export-ignore
45
.gitignore export-ignore
56
CHANGELOG.md export-ignore
67
LICENSE.md export-ignore

.github/workflows/code-quality.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
10+
env:
11+
fail-fast: true
12+
13+
jobs:
14+
code_quality:
15+
name: Code Quality Checks
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v6
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.4
26+
tools: composer:v2
27+
coverage: none
28+
29+
- name: Validate composer.json
30+
run: composer validate --no-check-publish --strict
31+
32+
- name: Install dependencies
33+
run: composer install --no-interaction --no-progress --prefer-dist
34+
35+
- name: Run PHP CodeSniffer
36+
run: composer cs
37+
38+
- name: Run PHPStan
39+
run: composer phpstan

.github/workflows/tests.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
schedule:
10+
- cron: '0 0 * * *'
11+
12+
jobs:
13+
linux_tests:
14+
name: PHP ${{ matrix.php }} - Linux
15+
runs-on: ubuntu-24.04
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v6
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
tools: composer:v2
30+
coverage: xdebug
31+
32+
- name: Install dependencies
33+
run: composer install --no-interaction --no-progress --prefer-dist
34+
35+
- name: Run tests
36+
run: vendor/bin/phpunit --coverage-clover coverage.xml
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
43+
windows_tests:
44+
name: PHP ${{ matrix.php }} - Windows
45+
runs-on: windows-2022
46+
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ]
51+
52+
steps:
53+
- name: Set git to use LF
54+
run: |
55+
git config --global core.autocrlf false
56+
git config --global core.eol lf
57+
58+
- name: Checkout code
59+
uses: actions/checkout@v6
60+
61+
- name: Setup PHP
62+
uses: shivammathur/setup-php@v2
63+
with:
64+
php-version: ${{ matrix.php }}
65+
tools: composer:v2
66+
67+
- name: Validate composer.json
68+
run: composer validate --strict
69+
70+
- name: Install dependencies
71+
run: composer install --no-interaction --no-progress --prefer-dist
72+
73+
- name: Run tests
74+
run: vendor/bin/phpunit

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
![License](https://img.shields.io/github/license/zaphyr-org/http-message?style=for-the-badge)
2-
![Version](https://img.shields.io/packagist/v/zaphyr-org/http-message?style=for-the-badge)
3-
![Downloads](https://img.shields.io/packagist/dt/zaphyr-org/http-message?style=for-the-badge)
4-
![Stars](https://img.shields.io/github/stars/zaphyr-org/http-message?style=for-the-badge)
5-
![Issues](https://img.shields.io/github/issues/zaphyr-org/http-message?style=for-the-badge)
1+
![License](https://img.shields.io/github/license/zaphyr-org/http-message)
2+
![Version](https://img.shields.io/packagist/v/zaphyr-org/http-message)
3+
![Issues](https://img.shields.io/github/issues/zaphyr-org/http-message)
4+
![Tests](https://github.com/zaphyr-org/http-message/actions/workflows/tests.yml/badge.svg)
5+
[![Codecov](https://codecov.io/gh/zaphyr-org/http-message/graph/badge.svg?token=2STP40KC71)](https://codecov.io/gh/zaphyr-org/http-message)
6+
67

78
# HTTP Message
89

@@ -11,7 +12,15 @@ Lightweight and strict implementation of [PSR-7 HTTP Message](https://www.php-fi
1112

1213
## System Requirements
1314

14-
You need `PHP => 8.1.0` but the latest stable version of PHP is recommended.
15+
You need `PHP => 8.1` but the latest stable version of PHP is recommended.
16+
17+
This package is continuously tested on the following PHP versions:
18+
19+
- PHP 8.1
20+
- PHP 8.2
21+
- PHP 8.3
22+
- PHP 8.4
23+
- PHP 8.5
1524

1625
## Installation
1726

phpunit.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,4 @@
1010
<directory suffix=".php">./src</directory>
1111
</include>
1212
</source>
13-
<coverage>
14-
<report>
15-
<html outputDirectory="./tests/report/code-coverage" lowUpperBound="50" highLowerBound="80"/>
16-
</report>
17-
</coverage>
18-
<logging>
19-
<testdoxHtml outputFile="./tests/report/testdox.html"/>
20-
</logging>
2113
</phpunit>

tests/Unit/UploadedFileTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ public function testMoveToThrowsExceptionWhenTargetDirectoryDoesNotExists(): voi
258258
{
259259
$this->expectException(RuntimeException::class);
260260

261-
(new UploadedFile(__FILE__, 100, UPLOAD_ERR_OK))->moveTo('/nope');
261+
$target = sys_get_temp_dir() . '/not-existing/file.txt';
262+
263+
(new UploadedFile(__FILE__, 100, UPLOAD_ERR_OK))->moveTo($target);
262264
}
263265

264266
public function testMoveToThrowsExceptionWhenTargetPathIsEmpty(): void

0 commit comments

Comments
 (0)