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

feat: add code and CI #1

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# actions-playground
# ci-playground
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);