Skip to content

Commit fbf1eaa

Browse files
committed
feat: Remove CircleCI and replace with GH workflow
1 parent 66fda1b commit fbf1eaa

File tree

4 files changed

+108
-49
lines changed

4 files changed

+108
-49
lines changed

.circleci/config.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build_and_test
2+
on:
3+
push:
4+
branches: [ main, develop ]
5+
pull_request:
6+
branches: [ main, develop ]
7+
8+
jobs:
9+
test:
10+
name: PHP ${{ matrix.php-version }} Test
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
15+
fail-fast: false # Continue with other versions even if one fails
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP ${{ matrix.php-version }}
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-version }}
25+
26+
- name: Cache Composer dependencies
27+
uses: actions/cache@v4
28+
with:
29+
path: vendor
30+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-php-${{ matrix.php-version }}-composer-
33+
34+
- name: Install Composer dependencies
35+
run: composer update
36+
37+
- name: Run tests
38+
run: composer test
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: static_analysis
2+
on:
3+
pull_request:
4+
# Run on push, but only if PHP files have changed
5+
push:
6+
branches: [ main, develop ]
7+
paths:
8+
- '**.php'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
- 'phpstan.neon'
12+
- '.github/workflows/static_analysis.yml'
13+
14+
env:
15+
GITHUB_ACTIONS_NOTIFY_ON_FAILURE: false
16+
17+
jobs:
18+
phpstan:
19+
name: Static Analysis
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: '8.4'
29+
30+
- name: Cache Composer dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
35+
restore-keys: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
36+
37+
- name: Install Composer dependencies
38+
run: composer update --no-interaction --prefer-dist
39+
40+
- name: Run PHPStan
41+
run: composer analyse
42+
continue-on-error: true

composer.json

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "nails/driver-invoice-gocardless",
3-
"keywords": [
3+
"keywords":
4+
[
45
"Nails",
56
"Shed Collective",
67
"CodeIgniter",
@@ -12,43 +13,58 @@
1213
"homepage": "http://nailsapp.co.uk/modules/invoice/driver/gocardless",
1314
"description": "This is the \"GoCardless\" driver for the Nails Invoice module.",
1415
"license": "MIT",
15-
"authors": [
16+
"authors":
17+
[
1618
{
1719
"name": "Pablo de la Pena",
1820
"email": "p@nailsapp.co.uk",
1921
"homepage": "http://nailsapp.co.uk",
2022
"role": "Developer"
2123
}
2224
],
23-
"support": {
25+
"support":
26+
{
2427
"email": "hello@nailsapp.co.uk"
2528
},
2629
"minimum-stability": "dev",
2730
"prefer-stable": true,
28-
"require": {
31+
"require":
32+
{
2933
"nails/module-invoice": "dev-develop",
3034
"gocardless/gocardless-pro": "4.*"
3135
},
32-
"require-dev": {
33-
"phpunit/phpunit": "9.*"
36+
"require-dev":
37+
{
38+
"phpunit/phpunit": "9.*",
39+
"phpstan/phpstan": "1.*"
3440
},
35-
"autoload": {
36-
"psr-4": {
41+
"scripts":
42+
{
43+
"test": "./vendor/bin/phpunit",
44+
"analyse": "./vendor/bin/phpstan analyse -c .phpstan/config.neon"
45+
},
46+
"autoload":
47+
{
48+
"psr-4":
49+
{
3750
"Nails\\Invoice\\Driver\\Payment\\": "src/",
3851
"Nails\\Invoice\\Driver\\Payment\\GoCardless\\": "src/GoCardless/"
3952
}
4053
},
41-
"extra": {
42-
"nails": {
54+
"extra":
55+
{
56+
"nails":
57+
{
4358
"name": "GoCardless",
4459
"type": "driver",
4560
"subType": "payment",
4661
"forModule": "nails/module-invoice",
4762
"namespace": "Nails\\Invoice\\Driver\\Payment\\GoCardless\\",
48-
"data": {
63+
"data":
64+
{
4965
"namespace": "Nails\\Invoice\\Driver\\Payment\\",
5066
"class": "GoCardless"
5167
}
5268
}
5369
}
54-
}
70+
}

0 commit comments

Comments
 (0)