-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from reload/README-refactor
README refactor
- Loading branch information
Showing
7 changed files
with
98 additions
and
17 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
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 |
---|---|---|
|
@@ -10,12 +10,14 @@ permissions: | |
|
||
jobs: | ||
actionlint: | ||
name: GitHub Actions | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: reviewdog/action-actionlint@v1 | ||
- name: Run actionlint | ||
uses: reviewdog/action-actionlint@v1 | ||
markdownlint: | ||
name: markdown | ||
name: Markdown | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -26,11 +28,27 @@ jobs: | |
**/*.md | ||
!README.md | ||
yamllint: | ||
name: Yamllint | ||
name: YAML | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Yamllint | ||
- name: Run yamllint | ||
uses: frenck/[email protected] | ||
with: | ||
strict: true | ||
shellcheck: | ||
name: Shell scripts | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run shellcheck | ||
uses: ludeeus/[email protected] | ||
env: | ||
SHELLCHECK_OPTS: -o all | ||
checkmake: | ||
name: Makfile | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run checkmake | ||
uses: Uno-Takashi/checkmake-action@main |
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,40 @@ | ||
--- | ||
name: README | ||
on: | ||
- pull_request | ||
- push | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-readme: | ||
name: Check README.md is up-to-date | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.4' | ||
tools: composer | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> "${GITHUB_OUTPUT}" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Build README.md | ||
run: | | ||
make README.md | ||
- name: Check README.md | ||
run: | | ||
git diff --exit-code README.md |
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 @@ | ||
FROM phpdoc/phpdoc:3@sha256:eede231f3f3f0308cfaba5dd39963c55b8912f4a7cacc81baa95b274c8736ae4 |
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
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -v | ||
|
||
PHPDOC_IMAGE_ID=$(docker build . 2>&1 >/dev/null | grep 'writing image' | cut -f 2 -d: | cut -f 1 -d ' ') | ||
|
||
# Build phpDoc in ./docs | ||
docker run --user="${UID}" --rm -v ".:/data" "${PHPDOC_IMAGE_ID}" | ||
|
||
# Build README.md from phpDocs CprNumber documentation | ||
( | ||
# Fix phpDoc using mixed as return type of constructor | ||
sed 's/\(__construct.*\): mixed/\1/' | | ||
# Remove heavy horizontal lines | ||
grep -v '\*\*\*' | | ||
# Remove phpDoc "generated on" timestamp | ||
grep -v 'Automatically generated on' | | ||
# Fix links to phpDoc | ||
sed 's/(\.\/\(.*\)\.md)/(src\/\1.php)/' | | ||
# Remove empty lines | ||
cat -s | ||
) <docs/classes/Reload/Cpr/CprNumber.md >README.md |
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