-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Emilien Escalle <neilime@users.noreply.github.com>
- Loading branch information
Showing
22 changed files
with
386 additions
and
209 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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
.git/ | ||
nbproject/ | ||
vendor/ | ||
build/ | ||
.phpdoc/ | ||
**/*.cache | ||
**/composer.lock | ||
vendor | ||
tools/vendor | ||
**/composer.lock | ||
**/tests/.phpunit.result.cache | ||
**/build/ | ||
# From tools/cache/.gitignore | ||
tools/cache/**/* | ||
!tools/cache/**/.gitignore |
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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
versioning-strategy: widen | ||
directory: "/" | ||
versioning-strategy: increase | ||
directories: | ||
- "/" | ||
- "/tools" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
time: "04:00" | ||
groups: | ||
dev-dependencies: | ||
dependency-type: development | ||
|
||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
time: "04:00" | ||
groups: | ||
github-actions-dependencies: | ||
patterns: | ||
- "*" |
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,77 @@ | ||
name: Shared - Continuous Integration for common tasks | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
checks: | ||
strategy: | ||
matrix: | ||
include: | ||
- php-versions: "8.1" | ||
- php-versions: "8.2" | ||
- php-versions: "8.3" | ||
stable: true | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: ⚙️ Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: none,iconv,dom,curl,mbstring,tokenizer,xml,xmlwriter,simplexml,ctype | ||
coverage: pcov | ||
|
||
- name: ♻️ Get composer cache directory | ||
id: composer-cache | ||
shell: bash | ||
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: ♻️ Cache composer dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: ⚙️ Install dependencies | ||
shell: bash | ||
run: | | ||
composer install --no-progress --prefer-dist --optimize-autoloader | ||
composer --working-dir=tools install --no-progress --prefer-dist --optimize-autoloader | ||
- name: ♻️ Tools cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: tools/cache | ||
key: ${{ runner.os }}-tools-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tools- | ||
- name: 👕 Lint | ||
if: matrix.stable | ||
run: composer php-cs-fixer -- --format=checkstyle | tools/vendor/bin/cs2pr | ||
|
||
- name: 🔬 Static analysis | ||
if: matrix.stable | ||
run: composer stan -- --error-format=checkstyle | tools/vendor/bin/cs2pr | ||
|
||
- name: ♻️ Tests cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: tests/.phpunit.result.cache | ||
key: ${{ runner.os }}-tests-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-tests- | ||
- name: 🧪 Test | ||
run: composer test:ci | ||
|
||
- name: 📊 Upload coverage results to Codecov | ||
if: matrix.stable | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
files: ./build/logs/clover.xml |
This file was deleted.
Oops, something went wrong.
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,110 @@ | ||
name: Main - Continuous Integration | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
ci: | ||
name: Continuous Integration | ||
uses: ./.github/workflows/__shared-ci.yml | ||
secrets: inherit | ||
|
||
docs-generate-site: | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
mkdir -p ./_site | ||
echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml | ||
to_title_case() { | ||
echo "$1" | awk '{ | ||
for (i=1; i<=NF; i++) { | ||
$i = toupper(substr($i, 1, 1)) tolower(substr($i, 2)) | ||
} | ||
}' | ||
} | ||
create_site_page() { | ||
page="$1" | ||
title="$(to_title_case "$2")" | ||
content_path="$3" | ||
echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page" | ||
echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page" | ||
} | ||
create_site_page "./_site/index.md" "Home" "./README.md" | ||
for filepath in ./docs/*.md; do | ||
filename=$(basename -- "$filepath") | ||
section="${filename%.*}" | ||
mkdir -p "./_site/$section" | ||
create_site_page "./_site/$section/index.md" "$section" "$filepath" | ||
done | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs-site | ||
path: ./_site | ||
|
||
docs-generate-phpdoc: | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 📃 Generate PHP documentation | ||
run: docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./_site/phpdoc | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs-phpdoc | ||
path: ./_site | ||
|
||
docs-publish: | ||
name: Publish documentation | ||
needs: [docs-generate-site, docs-generate-phpdoc] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: 'docs-*' | ||
path: ./ | ||
merge-multiple: true | ||
|
||
- name: ⚙️ Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./ | ||
destination: ./_site | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
|
||
- name: 🚀 Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,21 @@ | ||
name: Need fix to Issue | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
manual-commit-ref: | ||
description: "The SHA of the commit to get the diff for" | ||
required: true | ||
manual-base-ref: | ||
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here" | ||
required: false | ||
|
||
jobs: | ||
main: | ||
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@0.15.0 | ||
with: | ||
manual-commit-ref: ${{ inputs.manual-commit-ref }} | ||
manual-base-ref: ${{ inputs.manual-base-ref }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.