Skip to content

Commit f3b58c8

Browse files
authored
Merge pull request #148 from alies-dev/modernize/ci-and-tooling
chore: modernize CI, tooling, and test infrastructure
2 parents 07a470c + 7546dd3 commit f3b58c8

17 files changed

Lines changed: 269 additions & 98 deletions

.gitattributes

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
* text=auto
22

3+
/.github export-ignore
34
/doc export-ignore
45
/tests export-ignore
56
.editorconfig export-ignore
67
.gitattributes export-ignore
78
.gitignore export-ignore
8-
.scrutinizer.yml export-ignore
9-
.styleci.yml export-ignore
10-
.travis.yml export-ignore
11-
phpunit.xml export-ignore
9+
.php_cs.dist export-ignore
10+
psalm.xml export-ignore
11+
psalm-baseline.xml export-ignore
12+
phpunit.xml.dist export-ignore

.github/workflows/bc-check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Backward Compatibility Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
bc-check:
8+
name: Backward Compatibility Check
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.4'
20+
coverage: none
21+
22+
- name: Install dependencies
23+
run: composer update --no-interaction --prefer-dist
24+
25+
- name: Run BC Check
26+
run: vendor/bin/roave-backward-compatibility-check

.github/workflows/psalm.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Psalm
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
psalm:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.4'
19+
coverage: none
20+
21+
- name: Install dependencies
22+
run: composer update --no-interaction --prefer-dist
23+
24+
- name: Run Psalm
25+
run: vendor/bin/psalm --no-progress

.github/workflows/tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
tests:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: ['8.2', '8.3', '8.4', '8.5']
16+
17+
name: PHP ${{ matrix.php }}
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
coverage: none
27+
28+
- name: Install dependencies
29+
run: composer update --no-interaction --prefer-dist
30+
31+
- name: Run tests
32+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.idea/
21
/bin/
32
/vendor/
43
composer.lock
54
phpunit.xml
65
.php_cs.cache
6+
.phpunit.cache
77
.phpunit.result.cache

.scrutinizer.yml

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

.styleci.yml

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

.travis.yml

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

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# <img src="https://s3.amazonaws.com/swap.assets/swap_logo.png" height="30px" width="30px"/> Swap
22

3-
[![Build status](http://img.shields.io/travis/florianv/swap.svg?style=flat-square)](https://travis-ci.org/florianv/swap)
3+
[![Tests](https://github.com/florianv/swap/actions/workflows/tests.yml/badge.svg)](https://github.com/florianv/swap/actions/workflows/tests.yml)
4+
[![Psalm](https://github.com/florianv/swap/actions/workflows/psalm.yml/badge.svg)](https://github.com/florianv/swap/actions/workflows/psalm.yml)
45
[![Total Downloads](https://img.shields.io/packagist/dt/florianv/swap.svg?style=flat-square)](https://packagist.org/packages/florianv/swap)
56
[![Version](http://img.shields.io/packagist/v/florianv/swap.svg?style=flat-square)](https://packagist.org/packages/florianv/swap)
67

composer.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
{
22
"name": "florianv/swap",
33
"description": "Exchange rates library for PHP",
4-
"keywords": ["currency", "money", "rate", "conversion", "exchange rates"],
4+
"keywords": [
5+
"currency",
6+
"money",
7+
"rate",
8+
"conversion",
9+
"exchange rates"
10+
],
511
"license": "MIT",
612
"authors": [
713
{
@@ -21,29 +27,34 @@
2127
}
2228
},
2329
"require": {
24-
"php": "^7.1.3 || ^8.0",
30+
"php": "^8.2",
2531
"florianv/exchanger": "^2.0",
26-
"symfony/http-client": "^5.4",
27-
"php-http/message-factory": "^1.1"
32+
"php-http/discovery": "^1.0"
2833
},
2934
"require-dev": {
30-
"phpunit/phpunit": "^7 || ^8 || ^9",
35+
"phpunit/phpunit": "^11.0 || ^12.0",
3136
"php-http/mock-client": "^1.0",
3237
"php-http/message": "^1.7",
3338
"nyholm/psr7": "^1.0",
34-
"php-http/discovery": "^1.0"
35-
},
36-
"suggest": {
37-
"php-http/discovery": "If you are not using `useHttpClient` but instead want to auto-discover HttpClient"
39+
"vimeo/psalm": "^6.0",
40+
"roave/backward-compatibility-check": "^8.9"
3841
},
3942
"scripts": {
40-
"test": "vendor/bin/phpunit"
43+
"test": "vendor/bin/phpunit",
44+
"psalm": "vendor/bin/psalm --no-progress",
45+
"cs:fix": "vendor/bin/php-cs-fixer fix --no-interaction --ansi --quiet",
46+
"cs:check": "vendor/bin/php-cs-fixer fix --no-interaction --ansi --verbose --dry-run"
4147
},
4248
"extra": {
4349
"branch-alias": {
4450
"dev-master": "4.0-dev"
4551
}
4652
},
53+
"suggest": {
54+
"php-http/discovery": "Auto-discover PSR-18 HTTP client and PSR-17 request factory",
55+
"symfony/http-client": "PSR-18 HTTP client implementation",
56+
"nyholm/psr7": "PSR-17 HTTP factory implementation"
57+
},
4758
"config": {
4859
"allow-plugins": {
4960
"php-http/discovery": true

0 commit comments

Comments
 (0)