generated from glhd/laravel-package-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7be2a48
Showing
29 changed files
with
1,238 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
exclude_patterns: | ||
- ".github/" | ||
- ".idea/" | ||
- "stubs/" | ||
- "tests/" | ||
- "**/vendor/" | ||
- "**/node_modules/" | ||
- "*.md" | ||
- ".*.yml" | ||
- "LICENSE" | ||
- "composer.json" | ||
- "phpunit.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**What version does this affect?** | ||
- Laravel Version: [e.g. 10.0.0] | ||
- Package Version: [e.g. 1.5.0] | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest a new feature idea or improvement | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Code Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
|
||
name: Publish code coverage | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv | ||
coverage: pcov | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
vendor | ||
${{ steps.composer-cache-files-dir.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
env: | ||
COMPOSER_DISCARD_CHANGES: true | ||
run: composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:10.*" "orchestra/testbench:8.*" | ||
|
||
- name: Run and publish code coverage | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
with: | ||
coverageCommand: vendor/bin/phpunit --coverage-clover ${{ github.workspace }}/clover.xml | ||
debug: true | ||
coverageLocations: | ||
"${{github.workspace}}/clover.xml:clover" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Code Style | ||
|
||
on: [ pull_request, push ] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
|
||
name: Run code style checks | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
vendor | ||
${{ steps.composer-cache-files-dir.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
env: | ||
COMPOSER_DISCARD_CHANGES: true | ||
run: composer require --no-progress --no-interaction --prefer-dist --update-with-all-dependencies "laravel/framework:10.*" "orchestra/testbench:8.*" | ||
|
||
- name: Run PHP CS Fixer | ||
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: PHPUnit | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 14 * * 3' # Run Wednesdays at 2pm EST | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: [ 8.1, 8.2, 8.3 ] | ||
laravel: [ 10.*, 11.* ] | ||
dependency-version: [ stable, lowest ] | ||
include: | ||
- laravel: 10.* | ||
testbench: 8.* | ||
- laravel: 11.* | ||
testbench: 9.* | ||
exclude: | ||
- laravel: 11.* | ||
php: 8.1 | ||
|
||
timeout-minutes: 10 | ||
|
||
name: "${{ matrix.php }} / ${{ matrix.laravel }} (${{ matrix.dependency-version }})" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, iconv | ||
tools: composer:v2 | ||
|
||
- name: Register composer cache directory | ||
id: composer-cache-files-dir | ||
run: | | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
vendor | ||
${{ steps.composer-cache-files-dir.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
run: | | ||
composer require --no-interaction --prefer-dist --no-update "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" | ||
composer update --no-interaction --prefer-dist --with-all-dependencies --prefer-${{ matrix.dependency-version }} | ||
- name: Execute tests | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Template Cleanup | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
template-cleanup: | ||
name: Template Cleanup | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.name != 'laravel-package-template' | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
- name: Cleanup | ||
run: | | ||
export LC_CTYPE=C | ||
export LANG=C | ||
NAME="${GITHUB_REPOSITORY##*/}" | ||
KEBAB=$(echo $NAME | tr -s -c '[:alpha:][:cntrl:]' ' ' | tr '[:upper:]' '[:lower:]' | tr ' ' '-') | ||
STUDLY="$(echo "$NAME" | awk '{split($0,a,"[_ -]"); for(i=1;i<=length(a);++i) printf "%s",(length(a[i]) > 0 ? toupper(substr(a[i],1,1)) tolower(substr(a[i],2)) : "")}')" | ||
# Replace placeholder names | ||
find . -type d \( -path "./.git" -o -path "./.github" \) -prune -o -type f -exec sed -i "s/laravel-package-template/$KEBAB/g" {} + | ||
find . -type d \( -path "./.git" -o -path "./.github" \) -prune -o -type f -exec sed -i "s/LaravelPackageTemplate/$STUDLY/g" {} + | ||
# Rename files | ||
git mv .idea/laravel-package-template.iml .idea/$KEBAB.iml | ||
git mv config/config.php config/$KEBAB.php | ||
git mv src/Support/LaravelPackageTemplateServiceProvider.php src/Support/${STUDLY}ServiceProvider.php | ||
# Cleanup | ||
rm -f .github/workflows/template-cleanup.yml | ||
- name: Show changes | ||
run: git status | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Template cleanup" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Update Changelog | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
update-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.repository.full_name }} | ||
ref: 'main' | ||
|
||
- name: Update changelog | ||
uses: thomaseizinger/keep-a-changelog-new-release@v1 | ||
with: | ||
version: ${{ github.event.release.tag_name }} | ||
|
||
- name: Commit changelog back to repo | ||
uses: EndBug/add-and-commit@v8 | ||
with: | ||
add: 'CHANGELOG.md' | ||
message: ${{ github.event.release.tag_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
.env | ||
|
||
.DS_Store | ||
.phpstorm.meta.php | ||
_ide_helper.php | ||
|
||
node_modules | ||
mix-manifest.json | ||
yarn-error.log |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.