Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
feat: add code and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed Mar 20, 2024
1 parent d3e08cf commit eac8f8e
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: QA

on: [pull_request]

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: PHP-CS-Fixer
uses: docker://jakzal/phpqa:1.96.3-php8.2-alpine
with:
args: php-cs-fixer --dry-run --diff --no-interaction --ansi fix --show-progress none src/
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tests

on: [pull_request]

jobs:
tests:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: intl

- name: Run tests
run: php -f ./src/script.php
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.php-cs-fixer.cache
/vendor/
16 changes: 16 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
;

$config = new PhpCsFixer\Config();

$config
->setFinder($finder)
->setRiskyAllowed(true)
;

return $config;
15 changes: 15 additions & 0 deletions src/script.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

$fmt = new IntlDateFormatter(
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);

echo 'Le premier format affiché est '.$fmt->format(0);

exit(0);

0 comments on commit eac8f8e

Please sign in to comment.