diff --git a/.editorconfig b/.editorconfig index f02a64bf..558bf795 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,10 +11,8 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false -[*.yml] -indent_style = space +[*.{yml,yaml}] indent_size = 2 -[*.json] -indent_style = space -indent_size = 4 +[Makefile] +indent_style = tab diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 0c1e1faf..89366804 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,7 @@ +--- + # These are supported funding model platforms github: cycle + +... diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 199204e9..633302b9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,3 +1,5 @@ +--- + name: Bug Report description: 🐛 File a bug report title: "🐛 " @@ -50,3 +52,5 @@ body: PHP 8.1 validations: required: true + +... diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e44b929d..6b50a696 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,6 +1,10 @@ +--- + blank_issues_enabled: false contact_links: - name: ❓ Start a discussion or ask a question. url: https://github.com/cycle/orm/discussions about: Please ask and answer questions here. + +... diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index f620279b..af3e88c1 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,3 +1,5 @@ +--- + name: Feature request description: 💡 Suggest an idea for this project title: "💡 " @@ -19,3 +21,5 @@ body: value: "I have an idea, listen to me!!" validations: required: true + +... diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..94895221 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,37 @@ +--- + +# This file is for the labeler workflow job +# Documentation https://github.com/marketplace/actions/labeler + +"type: feature": + - head-branch: ['^feature', '^feat', 'feature'] + +"type: documentation": + - changed-files: + - any-glob-to-any-file: ['./*.md'] + +"type: test": + - changed-files: + - any-glob-to-any-file: ['tests/**/*'] + +"type: maintenance": + - changed-files: + - any-glob-to-any-file: ['.github/**/*.yml', '*.yml', '*.json', '*.xml'] + +"mysql": + - changed-files: + - any-glob-to-any-file: ['src/Driver/MySQL/**/*', 'src/Config/MySQL/*'] + +"postgres": + - changed-files: + - any-glob-to-any-file: ['src/Driver/Postgres/**/*', 'src/Config/Postgres/*'] + +"sqlite": + - changed-files: + - any-glob-to-any-file: ['src/Driver/SQLite/**/*', 'src/Config/SQLite/*'] + +"sqlserver": + - changed-files: + - any-glob-to-any-file: ['src/Driver/SQLServer/**/*', 'src/Config/SQLServer/*'] + +... diff --git a/.github/workflows/apply-labels.yml b/.github/workflows/apply-labels.yml new file mode 100644 index 00000000..c9b1196b --- /dev/null +++ b/.github/workflows/apply-labels.yml @@ -0,0 +1,23 @@ +--- + +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler/blob/master/README.md + +on: # yamllint disable-line rule:truthy + pull_request: + +name: 🏷️ Add labels + +jobs: + label: + uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master + with: + os: ubuntu-latest + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + +... diff --git a/.github/workflows/ci-mssql.yml b/.github/workflows/ci-mssql.yml index 4eec0818..e6583762 100644 --- a/.github/workflows/ci-mssql.yml +++ b/.github/workflows/ci-mssql.yml @@ -1,4 +1,6 @@ -on: +--- + +on: # yamllint disable-line rule:truthy push: branches: - master @@ -39,14 +41,14 @@ jobs: services: mssql: - image: mcr.microsoft.com/mssql/${{ matrix.mssql }} - env: - SA_PASSWORD: SSpaSS__1 - ACCEPT_EULA: Y - MSSQL_PID: Developer - ports: - - 11433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SSpaSS__1' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + image: mcr.microsoft.com/mssql/${{ matrix.mssql }} + env: + SA_PASSWORD: SSpaSS__1 + ACCEPT_EULA: Y + MSSQL_PID: Developer + ports: + - 11433:1433 + options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SSpaSS__1' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout @@ -86,3 +88,5 @@ jobs: env: DB: sqlserver run: vendor/bin/phpunit --group driver-sqlserver --colors=always + +... diff --git a/.github/workflows/ci-mysql.yml b/.github/workflows/ci-mysql.yml index 68493a65..0528dfde 100644 --- a/.github/workflows/ci-mysql.yml +++ b/.github/workflows/ci-mysql.yml @@ -1,4 +1,6 @@ -on: +--- + +on: # yamllint disable-line rule:truthy push: branches: - master @@ -96,3 +98,5 @@ jobs: DB: mysql MYSQL: ${{ matrix.mysql-version }} run: vendor/bin/phpunit --group driver-mysql --colors=always + +... diff --git a/.github/workflows/ci-pgsql.yml b/.github/workflows/ci-pgsql.yml index 2e18020b..237822e0 100644 --- a/.github/workflows/ci-pgsql.yml +++ b/.github/workflows/ci-pgsql.yml @@ -1,4 +1,6 @@ -on: +--- + +on: # yamllint disable-line rule:truthy push: branches: - master @@ -97,3 +99,5 @@ jobs: DB: postgres POSTGRES: ${{ matrix.pgsql-version }} run: vendor/bin/phpunit --group driver-postgres --colors=always + +... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc1fbff6..38047e13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,3 +25,5 @@ jobs: failOnWarnings: false failOnErrors: true helpURL: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint' + +... diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8281536..f6226756 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,8 @@ +--- + name: build -on: +on: # yamllint disable-line rule:truthy push: branches: - master @@ -102,3 +104,5 @@ jobs: DB: sqlite run: | vendor/bin/phpunit --group driver-sqlite --colors=always + +... diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f4da6834..1bb17d96 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,3 +1,5 @@ +--- + checks: php: true diff --git a/.styleci.yml b/.styleci.yml index ec5db6e8..a96133f2 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,3 +1,5 @@ +--- + preset: psr12 risky: true @@ -74,3 +76,5 @@ enabled: finder: exclude: - "tests/Database/Unit/Stub" + +... diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..7cb7cbbc --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,56 @@ +--- + +extends: default + +ignore: | + .build/ + vendor/ + +# Overwrite above default rules +rules: + braces: + # Defaults + # min-spaces-inside: 0 + # max-spaces-inside: 0 + + # Keep 0 min-spaces to not error on empty {} collection definitions + min-spaces-inside: 0 + + # Allow one space inside braces to improve code readability + max-spaces-inside: 1 + + brackets: + # Defaults + # min-spaces-inside: 0 + # max-spaces-inside: 0 + + # Keep 0 min-spaces to not error on empty [] collection definitions + min-spaces-inside: 0 + + # Allow one space inside braces to improve code readability + max-spaces-inside: 1 + + colons: + # Defaults + # min-spaces-before: 0 + # max-spaces-after: 1 + + # Allow multiple spaces after a colon to allow indentation of YAML + # dictionary values + max-spaces-after: -1 + + commas: + # Defaults + # max-spaces-after: 1 + + # Allow multiple spaces after a comma to allow indentation of YAML + # dictionary values + max-spaces-after: -1 + + comments: + require-starting-space: true + min-spaces-from-content: 1 + + line-length: disable + +... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff3d4934..f8133c89 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -118,4 +118,4 @@ Cycle DBAL is available under the [MIT license](/LICENSE). ## 🌐 Community and Conduct -Please ensure your interactions in the project are respectful and inclusive. Read our [Code of Conduct](https://github.com/cycle/database/blob/2.x/CODE_OF_CONDUCT.md) for more information. +Please ensure your interactions in the project are respectful and inclusive. Read our [Code of Conduct](https://github.com/cycle/database/blob/2.x/.github/CODE_OF_CONDUCT.md) for more information. diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 5ee2054f..9e892c28 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,3 +1,5 @@ +--- + version: "3" services: @@ -30,3 +32,5 @@ services: POSTGRES_DB: "spiral" POSTGRES_USER: "postgres" POSTGRES_PASSWORD: "postgres" + +...