Skip to content

Commit

Permalink
Merge pull request #1 from angelxmoreno/feature/setup
Browse files Browse the repository at this point in the history
Feature/setup
  • Loading branch information
angelxmoreno committed May 29, 2023
2 parents 0387ac2 + 87bd87d commit 41d170b
Show file tree
Hide file tree
Showing 16 changed files with 1,458 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: PHP Composer

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run CS Check
run: composer check

- name: Run Tests
run: composer test-ci

- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODE_COV_TOKEN }}
files: ./coverage.xml
verbose: true

- name: Upload to Codacy
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r ./coverage.xml --project-token=${{ secrets.CODACY_PROJECT_TOKEN }}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ composer.phar
# 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
coverage.xml
site
45 changes: 45 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "amoreno/prompt-classes",
"description": "ChatGpt reusable objects",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {
"PromptClasses\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PromptClasses\\Test\\": "tests/"
}
},
"authors": [
{
"name": "Angel S. Moreno",
"email": "angelxmoreno@gmail.com"
}
],
"require": {
"php": "^7.4",
"ext-json": "*"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.7",
"phpmd/phpmd": "^2.13",
"kahlan/kahlan": "^5.2"
},
"scripts": {
"test": "kahlan",
"coverage": "kahlan --coverage=4",
"test-ci": "kahlan --coverage=1 --clover=coverage.xml --reporter=tap",
"check": [
"@cs-check",
"@md-check"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"md-check": "phpmd src text ruleset",
"docs:serve": "mkdocs serve",
"docs:build": "mkdocs build && open site/index.html"
}
}
Loading

0 comments on commit 41d170b

Please sign in to comment.