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

Commit

Permalink
Merge pull request #1 from Troopers/feat-add-ci
Browse files Browse the repository at this point in the history
feat: add code and CI
  • Loading branch information
alexislefebvre authored Mar 20, 2024
2 parents d3e08cf + ff973b2 commit 29bbaf8
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
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);

0 comments on commit 29bbaf8

Please sign in to comment.