Skip to content

Commit

Permalink
Merge pull request #194: ci: auto apply labels based on files and bra…
Browse files Browse the repository at this point in the history
…nches
  • Loading branch information
roxblnfk authored Apr 8, 2024
2 parents 65eb0b6 + 795a8de commit cff7918
Show file tree
Hide file tree
Showing 18 changed files with 176 additions and 18 deletions.
8 changes: 3 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---

# These are supported funding model platforms

github: cycle

...
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: Bug Report
description: 🐛 File a bug report
title: "🐛 "
Expand Down Expand Up @@ -50,3 +52,5 @@ body:
PHP 8.1
validations:
required: true

...
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.

...
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: Feature request
description: 💡 Suggest an idea for this project
title: "💡 "
Expand All @@ -19,3 +21,5 @@ body:
value: "I have an idea, listen to me!!"
validations:
required: true

...
37 changes: 37 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -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/*']

...
23 changes: 23 additions & 0 deletions .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
@@ -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 }}

...
22 changes: 13 additions & 9 deletions .github/workflows/ci-mssql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on:
---

on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -86,3 +88,5 @@ jobs:
env:
DB: sqlserver
run: vendor/bin/phpunit --group driver-sqlserver --colors=always

...
6 changes: 5 additions & 1 deletion .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on:
---

on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down Expand Up @@ -96,3 +98,5 @@ jobs:
DB: mysql
MYSQL: ${{ matrix.mysql-version }}
run: vendor/bin/phpunit --group driver-mysql --colors=always

...
6 changes: 5 additions & 1 deletion .github/workflows/ci-pgsql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on:
---

on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down Expand Up @@ -97,3 +99,5 @@ jobs:
DB: postgres
POSTGRES: ${{ matrix.pgsql-version }}
run: vendor/bin/phpunit --group driver-postgres --colors=always

...
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ jobs:
failOnWarnings: false
failOnErrors: true
helpURL: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'

...
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---

name: build

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down Expand Up @@ -102,3 +104,5 @@ jobs:
DB: sqlite
run: |
vendor/bin/phpunit --group driver-sqlite --colors=always
...
2 changes: 2 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

checks:
php: true

Expand Down
4 changes: 4 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

preset: psr12
risky: true

Expand Down Expand Up @@ -74,3 +76,5 @@ enabled:
finder:
exclude:
- "tests/Database/Unit/Stub"

...
56 changes: 56 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -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

...
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

version: "3"

services:
Expand Down Expand Up @@ -30,3 +32,5 @@ services:
POSTGRES_DB: "spiral"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"

...

0 comments on commit cff7918

Please sign in to comment.