-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(actions): add release please workflow and lint (#8)
* style(php): apply cs fixer and phpstan * chore(ci): add automated tests and release * Update composer.json Co-authored-by: Lucas Mirloup <[email protected]> --------- Co-authored-by: Lucas Mirloup <[email protected]>
- Loading branch information
1 parent
4cebf33
commit e49ba42
Showing
15 changed files
with
142 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
env: | ||
PHP_EXTENSIONS: "zip" | ||
PHP_VERSION: "8.3" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
if: github.ref == 'refs/heads/master' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ env.PHP_VERSION }}" | ||
extensions: "${{ env.PHP_EXTENSIONS }}" | ||
tools: humbug/box | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- uses: google-github-actions/release-please-action@v4 | ||
id: create_release | ||
with: | ||
target-branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
|
||
strategy: | ||
matrix: | ||
php_version: ["7.4", "8.0", "8.1", "8.2", "8.3"] | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: "lephare/php:${{ matrix.php_version }}" | ||
env: | ||
XDEBUG_MODE: coverage | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies (PHP ${{ matrix.php_version }}) | ||
run: | | ||
composer config --global cache-dir .composer | ||
composer install --prefer-dist --no-interaction --no-progress | ||
- name: Coding Style (PHP ${{ matrix.php_version }}) | ||
run: | | ||
composer run-script lint:ci | ||
composer run-script analyse | ||
- name: Unit Tests (PHP ${{ matrix.php_version }}) | ||
run: composer run-script test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "2.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true"> | ||
<testsuites> | ||
<testsuite name="Import Test Suite"> | ||
<directory>./Tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory suffix=".dist.php">./</directory> | ||
<directory>./Resources</directory> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true"> | ||
<coverage> | ||
<include> | ||
<directory>./</directory> | ||
</include> | ||
<exclude> | ||
<directory suffix=".dist.php">./</directory> | ||
<directory>./Resources</directory> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Import Test Suite"> | ||
<directory>./Tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"release-type": "php", | ||
"include-component-in-tag": false, | ||
"packages": { | ||
".": { | ||
"changelog-path": "CHANGELOG.md", | ||
"draft": true, | ||
"package-name": "release-please-action", | ||
"release-type": "php" | ||
} | ||
} | ||
} |