Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/code-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ jobs:
- name: 'Setup jq'
uses: dcarbone/install-jq-action@v2
- name: Install PHP CS Fixer
run: composer global require friendsofphp/php-cs-fixer:${{ inputs.version }}
run: composer global require friendsofphp/php-cs-fixer:${INPUTS_VERSION}
env:
INPUTS_VERSION: ${{ inputs.version }}
- name: Run PHP CS Fixer
run: |
# set environment variables in script
export RULES=$(echo $'${{ inputs.rules }} ${{ inputs.add-rules }}'|tr -d '\n\t\r '|jq -s '.[0] * .[1]' -crM)
export EXCLUDE_PATTERNS=$(echo $'${{ inputs.exclude-patterns }}'|tr -d '\n\t\r ')
export RULES=$(echo $'${INPUTS_RULES} ${INPUTS_ADD_RULES}'|tr -d '\n\t\r '|jq -s '.[0] * .[1]' -crM)
export EXCLUDE_PATTERNS=$(echo $'${INPUTS_EXCLUDE_PATTERNS}'|tr -d '\n\t\r ')

# use config path only if EXCLUDE_PATTERN is empty
CMD_PATH=$([ "$EXCLUDE_PATTERNS" = "" ] && echo "$CONFIG_PATH" || echo "")
Expand All @@ -93,3 +95,7 @@ jobs:
echo ""
exit 1
fi
env:
INPUTS_RULES: ${{ inputs.rules }}
INPUTS_ADD_RULES: ${{ inputs.add-rules }}
INPUTS_EXCLUDE_PATTERNS: ${{ inputs.exclude-patterns }}
21 changes: 15 additions & 6 deletions .github/workflows/doctum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ jobs:
use Doctum\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$defaultVersion = '${{ inputs.default_version }}';
$tagPattern = '${{ inputs.tag_pattern }}';
$defaultVersion = '${INPUTS_DEFAULT_VERSION}';
$tagPattern = '${INPUTS_TAG_PATTERN}';

$iterator = Finder::create()
->files()
->name('*.php')
->notName('${{ inputs.exclude_file }}')
->notName('${INPUTS_EXCLUDE_FILE}')
->exclude('GPBMetadata')
->in(__DIR__ . '/src');

Expand All @@ -71,8 +71,8 @@ jobs:
}

return new Doctum($iterator, [
'title' => '${{ inputs.title }}',
'theme' => '${{ inputs.theme }}',
'title' => '${INPUTS_TITLE}',
'theme' => '${INPUTS_THEME}',
'versions' => $versions,
'build_dir' => __DIR__ . '/.build/%version%',
'cache_dir' => __DIR__ . '/.cache/%version%',
Expand All @@ -84,6 +84,12 @@ jobs:
)
echo "$DOCTUM_CONFIG"; # for debugging
echo "$DOCTUM_CONFIG" > doctum-config.php;
env:
INPUTS_DEFAULT_VERSION: ${{ inputs.default_version }}
INPUTS_TAG_PATTERN: ${{ inputs.tag_pattern }}
INPUTS_EXCLUDE_FILE: ${{ inputs.exclude_file }}
INPUTS_TITLE: ${{ inputs.title }}
INPUTS_THEME: ${{ inputs.theme }}
- name: Run Doctum to Generate Documentation
run: |
php doctum.phar update doctum-config.php --ignore-parse-errors
Expand All @@ -95,8 +101,11 @@ jobs:
name: Redirect Index to Latest Version
run: |
cat << EOF > .build/index.html
<meta http-equiv='refresh' content='0;url=/${{ github.event.repository.name }}/${{ inputs.default_version }}'>
<meta http-equiv='refresh' content='0;url=/${GITHUB_EVENT_REPOSITORY_NAME}/${INPUTS_DEFAULT_VERSION}'>
EOF
env:
GITHUB_EVENT_REPOSITORY_NAME: ${{ github.event.repository.name }}
INPUTS_DEFAULT_VERSION: ${{ inputs.default_version }}
- if: ${{ !inputs.dry_run }}
name: Move generated files into GitHub Pages branch
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- name: Run Script
run: |
composer install -q
composer global require phpstan/phpstan:${{ inputs.version }} -q
~/.composer/vendor/bin/phpstan analyse ${{ inputs.paths }} \
--autoload-file=${{ inputs.autoload-file }}
composer global require phpstan/phpstan:${INPUTS_VERSION} -q
~/.composer/vendor/bin/phpstan analyse ${INPUTS_PATHS} \
--autoload-file=${INPUTS_AUTOLOAD_FILE}
env:
INPUTS_VERSION: ${{ inputs.version }}
INPUTS_PATHS: ${{ inputs.paths }}
INPUTS_AUTOLOAD_FILE: ${{ inputs.autoload-file }}
Loading