Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs workflow file #405

Merged
merged 16 commits into from
Aug 30, 2024
Merged

feat: add docs workflow file #405

merged 16 commits into from
Aug 30, 2024

Conversation

jamescalam
Copy link
Member

@jamescalam jamescalam commented Aug 30, 2024

PR Type

enhancement, documentation


Description

  • Introduced a new GitHub Actions workflow file to automate the building of documentation.
  • The workflow is triggered on pull requests and runs on the latest Ubuntu environment.
  • It sets up a Python environment using Poetry and installs necessary dependencies.
  • The documentation is built using Sphinx, with caching implemented for Poetry to improve efficiency.

Changes walkthrough 📝

Relevant files
Enhancement
docs.yml
Add GitHub Actions workflow for documentation build           

.github/workflows/docs.yml

  • Added a new GitHub Actions workflow for building documentation.
  • Configured the workflow to trigger on pull requests.
  • Set up a job to build documentation using Sphinx.
  • Utilized caching for Poetry dependencies.
  • +40/-0   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @github-actions github-actions bot added documentation Improvements or additions to documentation enhancement Enhancement to existing features Review effort [1-5]: 2 labels Aug 30, 2024
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    Copy link

    github-actions bot commented Aug 30, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Performance
    Refine the caching strategy for Poetry to enhance cache effectiveness

    To improve cache efficiency and restore performance, consider using a more granular
    key for the Poetry cache that includes both the Python version and the hash of
    poetry.lock.

    .github/workflows/docs.yml [22-24]

    -key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
    +key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
     restore-keys: |
    -  ${{ runner.os }}-poetry-
    +  ${{ runner.os }}-poetry-${{ matrix.python-version }}-
     
    Suggestion importance[1-10]: 9

    Why: Including both the Python version and the hash of poetry.lock in the cache key can significantly improve cache efficiency and restore performance, making this a valuable enhancement for the workflow.

    9
    Use a Docker container with Poetry pre-installed to reduce workflow runtime

    Instead of installing poetry with pipx in each run, consider using a Docker
    container that already has poetry installed. This can reduce the runtime of your
    workflow by avoiding repeated installations.

    .github/workflows/docs.yml [26-27]

    -- name: Install poetry
    -  run: |
    -    pipx install poetry==$POETRY_VERSION
    +- name: Use Docker container with Poetry
    +  uses: docker://python:3.11-poetry
     
    Suggestion importance[1-10]: 7

    Why: Using a Docker container with Poetry pre-installed can reduce the workflow runtime by avoiding repeated installations. This suggestion improves performance but may require additional setup and maintenance.

    7
    Best practice
    Use a specific version of the Ubuntu runner to ensure consistent CI behavior

    Consider using a more specific version of the ubuntu-latest runner to ensure
    consistent behavior across different runs. Using a specific version helps avoid
    potential issues when the latest tag is updated to a new release.

    .github/workflows/docs.yml [9]

    -runs-on: ubuntu-latest
    +runs-on: ubuntu-22.04
     
    Suggestion importance[1-10]: 8

    Why: Using a specific version of the Ubuntu runner can help ensure consistent behavior across different runs, avoiding potential issues when the latest tag is updated to a new release. This is a best practice for CI/CD workflows.

    8
    Explicitly align the Python setup with the Poetry cache version

    To ensure that the Python setup and Poetry cache are correctly aligned, explicitly
    specify the Python version in the cache key used for Poetry.

    .github/workflows/docs.yml [32]

    -cache: poetry
    +cache: poetry-${{ matrix.python-version }}
     
    Suggestion importance[1-10]: 8

    Why: Specifying the Python version in the cache key ensures that the Python setup and Poetry cache are correctly aligned, which is a best practice for maintaining consistency and avoiding potential mismatches.

    8

    Copy link

    codecov bot commented Aug 30, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 63.14%. Comparing base (39deb46) to head (9a573f3).
    Report is 17 commits behind head on main.

    Additional details and impacted files
    @@           Coverage Diff           @@
    ##             main     #405   +/-   ##
    =======================================
      Coverage   63.14%   63.14%           
    =======================================
      Files          46       46           
      Lines        3424     3424           
    =======================================
      Hits         2162     2162           
      Misses       1262     1262           

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    @jamescalam jamescalam merged commit 286510f into main Aug 30, 2024
    8 checks passed
    @jamescalam jamescalam deleted the james/deploy-docs branch August 30, 2024 19:13
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    documentation Improvements or additions to documentation enhancement Enhancement to existing features Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant