Skip to content

Commit bfe1dad

Browse files
committed
[Release] Initial commit
0 parents  commit bfe1dad

26 files changed

+1701
-0
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: softcreatr
2+
custom: ['https://ecologi.com/softcreatr?r=61212ab3fc69b8eb8a2014f4']

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 🐛 Bug Report
2+
description: Submit a bug report to help us improve.
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: "## 🐛 Bug Report"
8+
9+
- type: textarea
10+
id: bug-description
11+
attributes:
12+
label: Description
13+
description: A clear and concise description of what the bug is.
14+
validations:
15+
required: true
16+
17+
- type: checkboxes
18+
id: previous-research
19+
attributes:
20+
label: Have you spent some time to check if this issue has been raised before?
21+
options:
22+
- label: I have googled for a similar issue or checked our older issues for a similar bug
23+
required: true
24+
25+
- type: checkboxes
26+
id: code-of-conduct
27+
attributes:
28+
label: Have you read the Code of Conduct?
29+
options:
30+
- label: I have read the [Code of Conduct](https://github.com/SoftCreatR/php-perplexity-ai-sdk/blob/main/CODE_OF_CONDUCT.md)
31+
required: true
32+
33+
- type: textarea
34+
id: reproduction-steps
35+
attributes:
36+
label: To Reproduce
37+
description: Write your steps here
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
id: expected-behavior
43+
attributes:
44+
label: Expected behavior
45+
description: Write down what you thought would happen.
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: actual-behavior
51+
attributes:
52+
label: Actual Behavior
53+
description: Write what happened. Add screenshots, if applicable.
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: environment
59+
attributes:
60+
label: Your Environment
61+
description: Include as many relevant details about the environment you experienced the bug in (e.g., Environment, Operating system and version, etc.)
62+
validations:
63+
required: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 📚 Documentation
2+
description: Report an issue related to documentation.
3+
labels: ["documentation"]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## 📚 Documentation"
9+
10+
- type: textarea
11+
id: issue-description
12+
attributes:
13+
label: Description
14+
description: A clear and concise description of what the issue is.
15+
placeholder: Enter the issue details here.
16+
validations:
17+
required: true
18+
19+
- type: markdown
20+
attributes:
21+
value: "### Have you read the [Code of Conduct](https://github.com/SoftCreatR/php-perplexity-ai-sdk/blob/main/CODE_OF_CONDUCT.md)?"
22+
23+
- type: checkboxes
24+
id: code-of-conduct
25+
attributes:
26+
label: Code of Conduct
27+
description: Please confirm that you have read the Code of Conduct.
28+
options:
29+
- label: I have read the Code of Conduct
30+
required: true

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 💡 Feature / Idea
2+
description: Submit a proposal for a new feature.
3+
labels: ["feature"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: "## 💡 Feature / Idea"
8+
- type: textarea
9+
id: feature-description
10+
attributes:
11+
label: "A clear and concise description of what the feature is."
12+
placeholder: "Describe the feature here..."
13+
validations:
14+
required: true
15+
- type: checkboxes
16+
id: checked-previous-issues
17+
attributes:
18+
label: "Have you spent some time to check if this issue has been raised before?"
19+
description: "Please check if a similar issue has been raised before."
20+
options:
21+
- label: "I have googled for a similar issue or checked our older issues for a similar idea"
22+
required: true
23+
- type: checkboxes
24+
id: read-code-of-conduct
25+
attributes:
26+
label: "Have you read the [Code of Conduct](https://github.com/SoftCreatR/php-perplexity-ai-sdk/blob/main/CODE_OF_CONDUCT.md)?"
27+
options:
28+
- label: "I have read the Code of Conduct"
29+
required: true
30+
- type: textarea
31+
id: pitch
32+
attributes:
33+
label: "Pitch"
34+
description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable."
35+
placeholder: "Explain the reasoning behind the feature and provide examples..."
36+
validations:
37+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
3+
4+
Help us understand your motivation by explaining why you decided to make this change.
5+
6+
Happy contributing!
7+
8+
-->
9+
10+
# 🔀 Pull Request
11+
12+
## What does this PR do?
13+
14+
(Provide a description of what this PR does.)
15+
16+
## Test Plan
17+
18+
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
19+
20+
## Related PRs and Issues
21+
22+
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
syntax-check:
10+
runs-on: ubuntu-latest
11+
if: startsWith(github.event.head_commit.message, '[Release]')
12+
13+
strategy:
14+
matrix:
15+
php: [ '7.4', '8.0', '8.1', '8.2' ]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
26+
- name: Install Composer dependencies
27+
run: composer install --no-dev
28+
29+
- name: Check PHP syntax
30+
run: find {src,tests} -type f -name "*.php" -exec php -l {} \;
31+
32+
analyze-code:
33+
needs: syntax-check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v3
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: '7.4'
43+
tools: php-cs-fixer, phpstan
44+
extensions: mbstring
45+
46+
- name: Install Composer dependencies
47+
run: composer install
48+
49+
- name: Run PHP-CS-Fixer
50+
run: php-cs-fixer fix --dry-run --diff
51+
52+
- name: Run PHPStan
53+
run: phpstan analyse src tests --xdebug
54+
55+
check-dependencies:
56+
needs: analyze-code
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v3
62+
63+
- name: Setup PHP
64+
uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: '7.4'
67+
68+
- name: Install Composer dependencies
69+
run: composer install
70+
71+
- name: Run security checker
72+
run: composer require --dev enlightn/security-checker && vendor/bin/security-checker security:check
73+
74+
run-tests:
75+
needs: check-dependencies
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@v3
81+
82+
- name: Setup PHP
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: '7.4'
86+
coverage: pcov
87+
ini-values: zend.assertions=1
88+
89+
- name: Install Composer dependencies
90+
run: composer install
91+
92+
- name: Run PHPUnit
93+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
94+
95+
- name: Upload coverage report to Codecov
96+
uses: codecov/codecov-action@v3
97+
with:
98+
token: ${{ secrets.CODECOV_TOKEN }}
99+
file: coverage.xml
100+
fail_ci_if_error: true
101+
102+
- name: Upload coverage report to Code Climate
103+
uses: paambaati/codeclimate-action@v3.2.0
104+
env:
105+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
106+
with:
107+
coverageLocations: ${{github.workspace}}/coverage.xml:clover
108+
109+
create-release:
110+
needs: run-tests
111+
runs-on: ubuntu-latest
112+
113+
steps:
114+
- name: Checkout code
115+
uses: actions/checkout@v3
116+
117+
- name: Setup PHP
118+
uses: shivammathur/setup-php@v2
119+
with:
120+
php-version: '7.4'
121+
122+
- name: Install Composer dependencies
123+
run: composer install --no-dev
124+
125+
- name: Get current version
126+
id: current-version
127+
run: |
128+
VERSION=$(composer config version --quiet)
129+
echo "Current version: $VERSION"
130+
echo "::set-output name=version::$VERSION"
131+
132+
- name: Create Release
133+
id: create-release
134+
uses: actions/create-release@v1
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
with:
138+
tag_name: v${{ steps.current-version.outputs.version }}
139+
release_name: Release v${{ steps.current-version.outputs.version }}
140+
body: 'New release for version ${{ steps.current-version.outputs.version }}'
141+
draft: false
142+
prerelease: false
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Update Contributors
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-contributors:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Add contributors
22+
uses: BobAnkh/add-contributors@v0.2.2
23+
with:
24+
CONTRIBUTOR: '## Contributors ✨'
25+
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
IGNORED_CONTRIBUTORS: 'Sascha Greuel'

0 commit comments

Comments
 (0)