Skip to content

Commit e9682a1

Browse files
authored
Merge pull request #70 from tighten/nd/version-3
Version 3: Nova Stripe Package Complete Rewrite
2 parents b18165a + b38d6ef commit e9682a1

82 files changed

Lines changed: 1763 additions & 3162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request_target:
8+
types: [labeled]
9+
branches: [main]
10+
11+
jobs:
12+
test:
13+
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
14+
runs-on: ubuntu-latest
15+
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main')
16+
17+
strategy:
18+
max-parallel: 1
19+
matrix:
20+
php: [8.0, 8.1, 8.2, 8.3]
21+
laravel: [8.*, 9.*, 10.*, 11.*]
22+
exclude:
23+
- php: 8.2
24+
laravel: 8.*
25+
- php: 8.2
26+
laravel: 9.*
27+
- php: 8.3
28+
laravel: 8.*
29+
- php: 8.3
30+
laravel: 9.*
31+
- php: 8.0
32+
laravel: 10.*
33+
- php: 8.0
34+
laravel: 11.*
35+
- php: 8.1
36+
laravel: 11.*
37+
services:
38+
stripemock:
39+
image: stripe/stripe-mock:v0.141.0
40+
ports:
41+
- 12111
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v3
46+
47+
- name: Setup PHP
48+
uses: shivammathur/setup-php@v2
49+
with:
50+
php-version: ${{ matrix.php }}
51+
extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
52+
coverage: none
53+
54+
- name: Install dependencies
55+
run: |
56+
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"
57+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench" "phpunit/phpunit" --no-interaction --no-update
58+
composer update --prefer-dist --no-interaction --no-progress --no-suggest
59+
60+
- name: Copy .env.example to .env
61+
run: cp .env.testing.example .env.testing
62+
63+
- name: Run PHP tests
64+
run: vendor/bin/phpunit
65+
env:
66+
STRIPE_TEST_SECRET: "${{ secrets.STRIPE_SECRET }}"
67+
STRIPE_API_BASE: "127.0.0.1:${{ job.services.stripemock.ports[12111] }}"

.github/workflows/test.yml

Lines changed: 23 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Tests
1+
name: Laravel CI
22

33
on:
44
workflow_dispatch:
@@ -9,59 +9,30 @@ on:
99
branches: [main]
1010

1111
jobs:
12-
test:
13-
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
12+
laravel:
1413
runs-on: ubuntu-latest
15-
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main')
16-
1714
strategy:
18-
max-parallel: 1
1915
matrix:
20-
php: [8.0, 8.1, 8.2, 8.3]
21-
laravel: [8.*, 9.*, 10.*, 11.*]
22-
exclude:
23-
- php: 8.2
24-
laravel: 8.*
25-
- php: 8.2
26-
laravel: 9.*
27-
- php: 8.3
28-
laravel: 8.*
29-
- php: 8.3
30-
laravel: 9.*
31-
- php: 8.0
32-
laravel: 10.*
33-
- php: 8.0
34-
laravel: 11.*
35-
- php: 8.1
36-
laravel: 11.*
37-
services:
38-
stripemock:
39-
image: stripe/stripe-mock:v0.141.0
40-
ports:
41-
- 12111
16+
php-version: [8.2, 8.3]
4217

4318
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v3
46-
47-
- name: Setup PHP
48-
uses: shivammathur/setup-php@v2
49-
with:
50-
php-version: ${{ matrix.php }}
51-
extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
52-
coverage: none
53-
54-
- name: Install dependencies
55-
run: |
56-
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"
57-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench" "phpunit/phpunit" --no-interaction --no-update
58-
composer update --prefer-dist --no-interaction --no-progress --no-suggest
59-
60-
- name: Copy .env.example to .env
61-
run: cp .env.testing.example .env.testing
62-
63-
- name: Run PHP tests
64-
run: vendor/bin/phpunit
65-
env:
66-
STRIPE_TEST_SECRET: "${{ secrets.STRIPE_SECRET }}"
67-
STRIPE_API_BASE: "127.0.0.1:${{ job.services.stripemock.ports[12111] }}"
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
extensions: mbstring, pdo, bcmath, sqlite3
27+
tools: composer
28+
29+
- name: Install dependencies
30+
run: |
31+
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"
32+
composer install --no-progress --prefer-dist
33+
34+
- name: Run lint
35+
run: ./vendor/bin/duster lint
36+
37+
- name: Run tests
38+
run: ./vendor/bin/pest

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package-lock.json
55
composer.phar
66
composer.lock
7-
phpunit.xml
87
.phpunit.result.cache
98
.DS_Store
109
.env.testing

charges-detail.png

-141 KB
Binary file not shown.

charges-index.png

-257 KB
Binary file not shown.

composer.json

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,15 @@
99
"stripe"
1010
],
1111
"license": "MIT",
12-
"authors": [
13-
{
14-
"name": "Samantha Geitz",
15-
"email": "samantha@tighten.co"
16-
},
17-
{
18-
"name": "Alison Kirk",
19-
"email": "alison.kirk@tighten.co"
20-
}
21-
],
22-
"repositories": [
23-
{
24-
"type": "composer",
25-
"url": "https://nova.laravel.com"
26-
}
27-
],
2812
"require": {
29-
"php": "^7.4|^8.0|^8.1|^8.2|^8.3",
30-
"stripe/stripe-php": ">=5.0"
31-
},
32-
"require-dev": {
33-
"laravel/nova": "^4.0",
34-
"orchestra/testbench": ">=3.6.x-dev",
35-
"phpunit/phpunit": "9.5.*",
36-
"tightenco/duster": "^0.3.2"
13+
"php": "^8.1|^8.2|^8.3",
14+
"stripe/stripe-php": ">=5.0",
15+
"calebporzio/sushi": "^2.5"
3716
},
3817
"autoload": {
3918
"psr-4": {
40-
"Tighten\\NovaStripe\\": "src/"
41-
}
42-
},
43-
"autoload-dev": {
44-
"psr-4": {
45-
"Tighten\\NovaStripe\\Tests\\": "tests"
19+
"Tighten\\NovaStripe\\": "src/",
20+
"Tighten\\NovaStripe\\Tests\\": "tests/"
4621
}
4722
},
4823
"extra": {
@@ -55,9 +30,23 @@
5530
"config": {
5631
"sort-packages": true,
5732
"allow-plugins": {
58-
"dealerdirect/phpcodesniffer-composer-installer": true
33+
"pestphp/pest-plugin": true
5934
}
6035
},
6136
"minimum-stability": "dev",
62-
"prefer-stable": true
37+
"prefer-stable": true,
38+
"require-dev": {
39+
"orchestra/testbench": "^9.9",
40+
"pestphp/pest": "^3.7",
41+
"pestphp/pest-plugin-laravel": "^3.1",
42+
"rector/rector": "^2.0",
43+
"tightenco/duster": "^3.1",
44+
"laravel/nova": "^4.0 || ^5.0"
45+
},
46+
"repositories": [
47+
{
48+
"type": "composer",
49+
"url": "https://nova.laravel.com"
50+
}
51+
]
6352
}

customers-detail.png

-198 KB
Binary file not shown.

customers-index.png

-146 KB
Binary file not shown.

dist/css/tool.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)