-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (63 loc) · 2.56 KB
/
action.yml
File metadata and controls
75 lines (63 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: 'Generate PHP docs with clean/phpdoc-md'
description: 'GitHub action to generate PHP project documentation in MarkDown format. Based on clean/phpdoc-md library.'
branding:
icon: book
color: blue
inputs:
output_path:
description: "Path where to write generated documentation"
required: true
class_root_namespace:
description: "Root class namespace"
required: true
included_classes:
description: "Included classes list (supports glob style wildcards syntax; each line means one rule)"
required: true
runs:
using: 'composite'
steps:
- name: Setting env variables...
env:
GENERATOR_TMP_SUFIX: ${{ github.sha }}-${{ github.run_id }}-${{ github.github.run_attempt }}
GENERATOR_TMP_PATH: ${{ runner.temp }}
ACTION_BIN_PATH: ${{ github.action_path }}/bin
run: $ACTION_BIN_PATH/generate-env.sh "$GENERATOR_TMP_SUFIX" "$GENERATOR_TMP_PATH" "$ACTION_BIN_PATH" >> $GITHUB_ENV
shell: bash
- name: Creating tmp folders
run: $ACTION_BIN_PATH/create-temp-folders.sh
shell: bash
- name: Copying current project to tmp folder...
run: $ACTION_BIN_PATH/copy-current-project-to-tmp-folder.sh
shell: bash
- name: Getting PHP class list...
uses: impresscms-dev/generate-php-project-classes-list-file-action@v2.0.2
with:
output_file: ${{ env.PHP_CLASSES_ORIG_FILE }}
- name: Generating temp filtering rules file...
uses: DamianReeves/write-file-action@v1.3
with:
path: ${{ env.RULES_FILE }}
contents: "${{ inputs.included_classes }}"
write-mode: overwrite
- name: Filtering PHP classes list...
uses: impresscms-dev/filter-php-class-list-with-glob-like-rules-action@v2.0.4
with:
rules_file: ${{ env.RULES_FILE }}
input_file: ${{ env.PHP_CLASSES_ORIG_FILE }}
output_file: ${{ env.PHP_CLASSES_FILTERED_FILE }}
- name: Generating generator config...
env:
PHPDOCMD_FILE: ${{ env.COPY_DATA_PATH }}/.phpdoc-md
CLASS_ROOT_NAMESPACE: ${{ inputs.class_root_namespace }}
DOCS_PATH: ${{ inputs.output_path }}
run: $ACTION_BIN_PATH/generate-config.php "$PHPDOCMD_FILE" "$PHP_CLASSES_FILTERED_FILE" "$CLASS_ROOT_NAMESPACE" "$DOCS_PATH"
shell: bash
- name: Including documentation generator...
run: $ACTION_BIN_PATH/add-composer-packages.sh
shell: bash
- name: Generating documentation...
run: $ACTION_BIN_PATH/generate-docs.sh
shell: bash
- name: Deleting tmp data...
run: $ACTION_BIN_PATH/delete-temp-folders.sh
shell: bash