-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Part 1] Modernise package and tests #91
Changes from 6 commits
61a37f9
cab90a5
97e4159
888309f
cfbaf15
6bf45d0
70af7cc
74e48d4
167547d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: PHP Composer | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -12,7 +18,7 @@ jobs: | |
|
||
- uses: shivammathur/[email protected] | ||
with: | ||
php-version: '7.3' | ||
php-version: '8.2' | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
@@ -27,13 +33,13 @@ jobs: | |
${{ runner.os }}-php- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This options deprecated |
||
run: composer install --prefer-dist --no-progress | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
|
||
- name: Run test suite | ||
run: composer run-script test | ||
run: composer test | ||
env: # Set the secrets as environment variables | ||
EMARSYS_API_USERNAME: ${{ secrets.EMARSYS_API_USERNAME }} | ||
EMARSYS_API_SECRET: ${{ secrets.EMARSYS_API_SECRET }} | ||
Comment on lines
43
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer our integration tests didn't use Emarsys directly (I didn't realise it did until now). Not on my agenda for today, but will probably change it to a mock server of some sort. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/vendor/ | ||
/composer.lock | ||
.idea/ | ||
composer.phar | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @mention-me/integrations | ||
* @mention-me/partnerships |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "mention-me/emarsys", | ||
"description": "Emarsys RestFull API client", | ||
"description": "Emarsys API client", | ||
"require": { | ||
"php": ">=7.3", | ||
"php": "^8.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given tests are passing, and we're running this in a PHP 8.2 env (the platform) I think we're fine. |
||
"psr/http-client": "^1.0.1", | ||
"ext-json": "*" | ||
}, | ||
|
@@ -12,11 +12,23 @@ | |
"guzzlehttp/guzzle": "^7.0.1", | ||
"http-interop/http-factory-guzzle": "^1.0.0" | ||
}, | ||
"minimum-stability": "stable", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumped to stable - makes me feel much better. |
||
"config": { | ||
"allow-plugins": { | ||
"php-http/discovery": true | ||
} | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Snowcap\\Emarsys": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-0": { | ||
"Snowcap\\Emarsys\\Tests\\Unit\\": "tests/Unit/Suites/", | ||
"Snowcap\\Emarsys\\Tests\\Integration\\": "tests/Integration/Suites/" | ||
} | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHPStorm was unhappy with the namespaces. This should fix them. I moved us to PSR-4, which is why the |
||
"scripts": { | ||
"test": "phpunit tests/ --verbose" | ||
}, | ||
|
@@ -30,6 +42,5 @@ | |
"name": "Alex Oanea", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "dev" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were running the CI on push and PR, which didn't make much sense.