Skip to content

Commit

Permalink
Feature/57 prepare action inputs for several regimes (#72)
Browse files Browse the repository at this point in the history
- New Action Input logic affecting the current way of use.
- New project folder structure.
- New logic accepting more than just one mining regime.
- New way of writing the documentation via multiple README.md.
  • Loading branch information
MobiTikula authored Dec 12, 2024
1 parent c6a1600 commit 7ae023a
Show file tree
Hide file tree
Showing 45 changed files with 1,124 additions and 917 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/static_analysis_and_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Set PYTHONPATH environment variable
run: echo "PYTHONPATH=${GITHUB_WORKSPACE}/living_documentation_generator/living_documentation_generator" >> $GITHUB_ENV
- name: Check code coverage with Pytest
run: pytest --cov=. -v tests/ --cov-fail-under=80
443 changes: 115 additions & 328 deletions README.md

Large diffs are not rendered by default.

61 changes: 40 additions & 21 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
name: 'Living Documentation Generator'
description: 'Generates living documentation from current state of user defined GitHub repositories.'
inputs:
GITHUB_TOKEN:
# Base action inputs
GITHUB-TOKEN:
description: 'GitHub token for authentication.'
required: true
repositories:
description: 'JSON string defining the repositories to be included in the documentation generation.'
liv-doc-regime:
description: 'Enable or disable the LivDoc regime.'
required: true
project-state-mining:
description: 'Enable or disable mining of project state data.'
required: false
default: 'false'
verbose-logging:
description: 'Enable or disable verbose logging.'
required: false
default: 'false'
output-path:
description: 'Path to the generated living documentation files.'

# LivDoc-regime action inputs
liv-doc-repositories:
description: 'JSON string defining the repositories to be included in the documentation generation.'
required: false
default: './output'
structured-output:
default: '[]'
liv-doc-project-state-mining:
description: 'Enable or disable mining of project state data.'
required: false
default: 'false'
liv-doc-structured-output:
description: 'Enable or disable structured output.'
required: false
default: 'false'
group-output-by-topics:
liv-doc-group-output-by-topics:
description: 'Enable or disable grouping tickets by topics in the summary index.md file.'
required: false
default: 'false'
outputs:
output-path:
description: 'Path to the generated living documentation files'
description: 'Path to the generated living documentation files.'
value: ${{ steps.liv-doc-generator.outputs.output-path }}

branding:
Expand All @@ -51,16 +54,32 @@ runs:
export PYTHONPATH="${PYTHONPATH}:${ACTION_ROOT}/living-doc-generator"
shell: bash

- name: Call Living Documentation Generator
- name: Prepare environment based on mining regimes
run: |
# Set base env variables common for all regimes
echo "INPUT_GITHUB_TOKEN=${{ env.GITHUB-TOKEN }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_REGIME=${{ inputs.liv-doc-regime }}" >> $GITHUB_ENV
echo "INPUT_VERBOSE_LOGGING=${{ inputs.verbose-logging }}" >> $GITHUB_ENV
# Add LivDoc-specific env variables if the regime is enabled
if [[ "${{ inputs.liv-doc-regime }}" == "true" ]]; then
echo "INPUT_LIV_DOC_REPOSITORIES=$(echo '${{ inputs.liv-doc-repositories }}' | jq -c .)" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_PROJECT_STATE_MINING=${{ inputs.liv-doc-project-state-mining }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_STRUCTURED_OUTPUT=${{ inputs.liv-doc-structured-output }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS=${{ inputs.liv-doc-group-output-by-topics }}" >> $GITHUB_ENV
fi
shell: bash

- name: Run Living Documentation Generator
id: liv-doc-generator
env:
INPUT_GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
INPUT_REPOSITORIES: ${{ inputs.repositories }}
INPUT_PROJECT_STATE_MINING: ${{ inputs.project-state-mining }}
INPUT_VERBOSE_LOGGING: ${{ inputs.verbose-logging }}
INPUT_OUTPUT_PATH: ${{ inputs.output-path }}
INPUT_STRUCTURED_OUTPUT: ${{ inputs.structured-output }}

INPUT_GITHUB_TOKEN: ${{ env.INPUT_GITHUB_TOKEN }}
INPUT_LIV_DOC_REGIME: ${{ env.INPUT_LIV_DOC_REGIME }}
INPUT_VERBOSE_LOGGING: ${{ env.INPUT_VERBOSE_LOGGING }}
INPUT_LIV_DOC_REPOSITORIES: ${{ env.INPUT_LIV_DOC_REPOSITORIES }}
INPUT_LIV_DOC_PROJECT_STATE_MINING: ${{ env.INPUT_LIV_DOC_PROJECT_STATE_MINING }}
INPUT_LIV_DOC_STRUCTURED_OUTPUT: ${{ env.INPUT_LIV_DOC_STRUCTURED_OUTPUT }}
INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS: ${{ env.INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS }}
run: |
python ${{ github.action_path }}/main.py
shell: bash
Binary file modified img/vision.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7ae023a

Please sign in to comment.