Skip to content

Commit

Permalink
feat: created project skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanChepurnyi committed Jan 15, 2025
1 parent eb61723 commit 26ef87e
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/php-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PHP Package
on:
push:
pull_request:
workflow_call:
jobs:
format-check:
name: Check PSR12 Standarts
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
- run: composer install
shell: bash
- run: composer format:check
shell: bash
tests:
name: Run Tests
runs-on: ubuntu-24.04
strategy:
matrix:
php-version:
- 8.2
- 8.3
io-driver:
- eio
- uv
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.io-driver }}
tools: composer:v2
coverage: xdebug3
- run: composer install
shell: bash
- run: composer test
shell: bash
21 changes: 21 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Create Release

jobs:
verify-release:
uses: ./.github/workflows/php-package.yml
release-please:
needs: verify-release
runs-on: ubuntu-24.04
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: php
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
/composer.lock
/.idea
/.phpunit.cache
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
4 changes: 4 additions & 0 deletions bin/mysql2jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!env php
<?php

require_once __DIR__ . '/../vendor/autoload.php';
44 changes: 44 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "ecomdev/mysql-to-jsonl",
"description": "Export/Import JSONL files as data for MySQL tables",
"type": "library",
"require": {
"php": "~8.2",
"amphp/file": "~3.2",
"amphp/mysql": "~3.0",
"amphp/amp": "~3.0",
"revolt/event-loop": "~1.0",
"symfony/console": "~7.2"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0",
"phpunit/phpunit": "^11.5",
"brianium/paratest": "^7.7",
"ecomdev/testcontainers-magento-data":"~1.1"
},
"license": [
"MIT"
],
"keywords": [
"mysql", "jsonl", "backup"
],
"autoload": {
"psr-4": {
"EcomDev\\MySQL2JSONL\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"EcomDev\\MySQL2JSONL\\": "tests"
}
},
"scripts": {
"test": "XDEBUG_MODE=coverage paratest --coverage-text",
"format:check": "phpcs",
"format:write": "phpcbf"
},
"bin": [
"bin/mysql2jsonl"
],
"$schema": "https://getcomposer.org/schema.json"
}
24 changes: 24 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset name="EcomDev">
<description>The coding standard for EcomDev packages.</description>

<file>src</file>
<file>tests</file>
<exclude-pattern>tests/fixtures.php</exclude-pattern>

<arg value="np"/>
<arg name="colors"/>

<!-- Include some additional sniffs from the Generic standard -->
<rule ref="Generic.Commenting.DocComment"/>

<!-- Use Unix newlines -->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>

<rule ref="PSR2"/>
<rule ref="PSR12"/>
</ruleset>
15 changes: 15 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
<coverage ignoreDeprecatedCodeUnits="true">
</coverage>
</phpunit>
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "php",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"include-v-in-tag": false,
"prerelease": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
7 changes: 7 additions & 0 deletions src/ExportTableFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace EcomDev\MySQL2JSONL;

class ExportTableFactory
{
}
15 changes: 15 additions & 0 deletions tests/ExportTableTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace EcomDev\MySQL2JSONL;

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class ExportTableTest extends TestCase
{
#[Test]
public function itworks()
{
$this->assertTrue(true);
}
}

0 comments on commit 26ef87e

Please sign in to comment.