Skip to content

Commit

Permalink
Primeiro commit
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Mar 6, 2024
0 parents commit 593a528
Show file tree
Hide file tree
Showing 32 changed files with 7,357 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: librecodecoop
2 changes: 2 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: "Thanks for opening your first pull request in this repository! :v:"
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for Composer
- package-ecosystem: "composer" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
11 changes: 11 additions & 0 deletions .github/workflows/dependabot-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependabot auto approve
on: pull_request_target

jobs:
auto-aprove:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
steps:
- uses: hmarr/auto-approve-action@v3
44 changes: 44 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Lint

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'tests/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: php-cs

steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3

- name: Set up php
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
with:
php-version: 8.3
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
58 changes: 58 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Lint

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'tests/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

permissions:
contents: read

concurrency:
group: lint-php-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
php-lint:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ "8.3" ]

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint
run: composer run lint

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: php-lint

if: always()

name: php-lint-summary

steps:
- name: Summary status
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
42 changes: 42 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: PHPUnit

on: pull_request

permissions:
contents: read

concurrency:
group: phpunit-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
phpunit:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['8.3']

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
run: composer i

- name: PHPUnit
run: composer run test:unit
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/vendor-bin/**/vendor/
/vendor/
.vscode
.env
.php-cs-fixer.cache
.~lock.*#
.phpunit.cache
clover.xml
35 changes: 35 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* @copyright Copyright (c) 2023, Vitor Mattos <[email protected]>
*
* @author Vitor Mattos <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

declare(strict_types=1);

require_once './vendor/autoload.php';

$config = new PhpCsFixer\Config();
$config
->getFinder()
->ignoreVCSIgnored(true)
->notPath('vendor')
->notPath('vendor-bin')
->in(__DIR__);
return $config;
Loading

0 comments on commit 593a528

Please sign in to comment.