-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1075173
Showing
9 changed files
with
182 additions
and
0 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,20 @@ | ||
name: Packagist Deploy | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mnavarrocarter/[email protected] | ||
with: | ||
username: "GautierDele" | ||
api_token: ${{ secrets.PACKAGIST_TOKEN }} |
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,48 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: [ '8.3', '8.4' ] | ||
|
||
name: Tests on PHP ${{ matrix.php-version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
coverage: none | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php-version }}- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer i --prefer-dist --no-progress | ||
|
||
- name: Run test suite | ||
run: vendor/bin/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,4 @@ | ||
/vendor | ||
composer.lock | ||
.phpunit* | ||
.idea |
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,10 @@ | ||
FROM php:latest | ||
|
||
RUN apt update | ||
RUN apt install unzip curl -y | ||
|
||
RUN curl -sS https://getcomposer.org/installer -o /usr/local/composer-setup.php | ||
|
||
RUN php /usr/local/composer-setup.php --install-dir=/usr/local/bin --filename=composer | ||
|
||
RUN rm /usr/local/composer-setup.php |
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,44 @@ | ||
{ | ||
"name": "xefi/faker-php-files", | ||
"type": "library", | ||
"description": "Faker extension to generate files", | ||
"keywords": [ | ||
"faker", | ||
"file", | ||
"image" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Gautier Deleglise" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.3", | ||
"psr/container": "^2.0", | ||
"xefi/faker-php": "^0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^11" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Xefi\\Faker\\Files\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Xefi\\Faker\\Files\\Tests\\": "tests/" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"faker": { | ||
"providers": [ | ||
"Xefi\\Faker\\Files\\FakerFilesServiceProvider" | ||
] | ||
} | ||
} | ||
} |
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,8 @@ | ||
services: | ||
php: | ||
build: . | ||
image: php:latest | ||
volumes: | ||
- ./:/var/www/html | ||
working_dir: /var/www/html | ||
tty: true |
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
displayDetailsOnTestsThatTriggerWarnings="true" | ||
displayDetailsOnTestsThatTriggerDeprecations="true" | ||
backupStaticProperties="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory>src</directory> | ||
</include> | ||
</source> | ||
<php> | ||
</php> | ||
</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,10 @@ | ||
<?php | ||
|
||
namespace Xefi\Faker\Files\Extensions; | ||
|
||
class ImagesExtension | ||
{ | ||
public function image() { | ||
|
||
} | ||
} |
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,16 @@ | ||
<?php | ||
namespace Xefi\Faker\Files; | ||
|
||
use Xefi\Faker\Files\Extensions\ImagesExtension; | ||
use Xefi\Faker\Providers\Provider; | ||
|
||
class FakerFilesServiceProvider extends Provider | ||
{ | ||
public function boot(): void | ||
{ | ||
$this->extensions([ | ||
ImagesExtension::class | ||
]); | ||
} | ||
|
||
} |