Skip to content

Commit b7cff46

Browse files
committed
Initial package
0 parents  commit b7cff46

32 files changed

+1178
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 4

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.editorconfig export-ignore
2+
.gitattributes export-ignore
3+
.gitignore export-ignore
4+
phpstan.neon export-ignore
5+
phpunit.xml export-ignore
6+
tests export-ignore

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file
2+
* @ddevsr

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
8+
updates:
9+
- package-ecosystem: 'composer'
10+
directory: '/'
11+
schedule:
12+
interval: 'daily'
13+
14+
- package-ecosystem: 'github-actions'
15+
directory: '/'
16+
schedule:
17+
interval: 'daily'
18+
ignore:
19+
- dependency-name: '*'
20+
update-types:
21+
- 'version-update:semver-minor'
22+
- 'version-update:semver-patch'
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Code Analysis
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
env:
12+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
13+
COMPOSER_ROOT_VERSION: "dev-main"
14+
15+
jobs:
16+
code_analysis:
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
actions:
22+
-
23+
name: 'Composer Validate'
24+
run: composer validate
25+
26+
-
27+
name: 'PHP-CS-Fixer'
28+
run: composer lint
29+
30+
-
31+
name: 'Rector Dry Run'
32+
run: composer rector
33+
34+
-
35+
name: 'PHPStan'
36+
run: composer phpstan
37+
38+
name: ${{ matrix.actions.name }}
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: 8.3
46+
coverage: none
47+
48+
- uses: ramsey/composer-install@v2
49+
50+
- run: ${{ matrix.actions.run }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Downgraded Release
2+
3+
# https://tomasvotruba.com/blog/how-to-release-php-81-and-72-package-in-the-same-repository/
4+
# https://github.com/TomasVotruba/cognitive-complexity/blob/main/.github/workflows/downgraded_release.yaml
5+
# https://github.com/symplify/config-transformer/blob/main/.github/workflows/downgraded_release.yaml
6+
7+
on:
8+
push:
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
downgrade_release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
-
18+
uses: "actions/checkout@v4"
19+
20+
-
21+
uses: "shivammathur/setup-php@v2"
22+
with:
23+
php-version: 8.2
24+
coverage: none
25+
26+
- uses: "ramsey/composer-install@v2"
27+
28+
# downgrade /src to PHP 7.2
29+
- run: vendor/bin/rector process src config --config build/rector-downgrade-php-72.php --ansi
30+
31+
# copy PHP 7.2 composer
32+
- run: cp build/composer-php-72.json composer.json
33+
34+
# clear the dev files
35+
- run: rm -rf build .github tests phpstan.neon phpunit.xml
36+
37+
# setup git user
38+
-
39+
run: |
40+
git config user.email "[email protected]"
41+
git config user.name "GitHub Action"
42+
43+
# publish to the same repository with a new tag
44+
-
45+
name: "Tag Downgraded Code"
46+
run: |
47+
git commit -a -m "release PHP 7.2 downgraded ${GITHUB_REF#refs/tags/}"
48+
49+
# force push tag, so there is only 1 version
50+
git tag "${GITHUB_REF#refs/tags/}" --force
51+
git push origin "${GITHUB_REF#refs/tags/}" --force
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check conflict branch in PR
2+
on:
3+
schedule:
4+
- cron: '*/780 * * * *' # Run at every 240 minutes / 4 hour
5+
6+
jobs:
7+
build:
8+
name: Check conflict branch in PR
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Check conflict branch in PR
18+
uses: PHPDevsr/[email protected]
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
label: stale
22+
comment: |
23+
:wave: Hi, @authorTarget!
24+
25+
We detected conflicts in your PR against the base branch :speak_no_evil:
26+
You may want to sync :arrows_counterclockwise: your branch with upstream!
27+
28+
Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check Signed PR
2+
on:
3+
pull_request:
4+
branches:
5+
- 'main'
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
jobs:
16+
build:
17+
name: Check Signed Commit
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Check signed commits in PR
24+
uses: 1Password/[email protected]
25+
with:
26+
comment: |
27+
You must GPG-sign your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open-source project. See Developer's Certificate of Origin. See [signing][1].
28+
29+
**Note that all your commits must be signed.** If you have an unsigned commit, you can sign the previous commits by referring to [gpg-signing-old-commits][2].
30+
[1]: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing
31+
[2]: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#gpg-signing-old-commits
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
env:
12+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
13+
COMPOSER_ROOT_VERSION: "dev-main"
14+
15+
jobs:
16+
tests:
17+
runs-on: ubuntu-latest
18+
19+
name: Tests
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
-
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.2
27+
coverage: none
28+
29+
- uses: "ramsey/composer-install@v1"
30+
31+
- run: vendor/bin/phpunit

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/vendor
2+
composer.lock
3+
4+
# PHPStorm meta files
5+
.idea/
6+
7+
.phpunit.result.cache
8+
.phpunit.cache
9+
.php-cs-fixer.cache

0 commit comments

Comments
 (0)