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

Update 'github-pages.yaml' Workflow - Fix several warnings & enable Caching pip packages #2539

Merged

Conversation

og-mrk
Copy link
Contributor

@og-mrk og-mrk commented Aug 8, 2024

Type of Change

  • Refactoring
  • CI/CD improvement

Description

This PR Makes github-pages.yaml Workflow more maintainable/readable, also makes git-revision-date-localized-plugin plugin work by pull all commit history (see references for more info), and make github-pages.yaml generate no warnings*.. Except for nodejs warning, which can be resolved by updating actions/setup-python to v5.. but it can't be done at the moment, as it's pinned to use v4 or less. The reason behind this version pinning is unclear... Fixed in this commit, see my review comments on why I've updated this action.

Nonetheless, these changes should make github-pages.yaml workflow cache the results (downloads) of pip packages, and these packages are specified in the new requirements.txt file, which's a common file used in Python Environments, which specifies every package to install, and what version to use, using PackageName==SpecificVersion Syntax.

How to make requirements.txt File (Step By Step)







Testing

Ran this GitHub Action manually on this PR Branch, and it works as expected.

Note

The first run would take much longer then next runs.. as it's compressing & using GitHub's Built-in functionality of Caching between Workflow Runs, more info can be found in references below.

Impact

Won't have a much impact on building/deploying the Docs website.. it'll shave a few seconds here & there, but IMHO it's better than nothing, and lowering Runtime Usage is always a good thing.

Issue related to PR

Additional Information (References)

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

@og-mrk og-mrk requested a review from ChrisTitusTech as a code owner August 8, 2024 06:55
@og-mrk
Copy link
Contributor Author

og-mrk commented Aug 8, 2024

@ChrisTitusTech
image

…for Dependabot in '.github/dependabot.yml' File
fetch-depth: '0' # Fetch all commit history for all branches as well as tags.

- name: Setup Python
uses: actions/setup-python@v5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason behind upgrading actions/setup-python to v5 is pretty simple.. it just works after upgrading this action, and I can confirm this after testing it in a new branch.

I've branched-out & committed/pushed a very simple commit, which even after deleting the branch, still exists thanks to GitHub having everything stay even after "Deleting" it, which's an awesome feature for some people.. but somewhat terrifying to others, but nonetheless.. it does work & produces no errors/fails to build & deploy the docs website, link to the run.

Comment on lines -10 to -11
- dependency-name: "actions/setup-python"
versions: '> 4'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read this review comment to understand why I've removed this Dependabot Rule.

Copy link
Contributor Author

@og-mrk og-mrk Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying each and every dependency & sub-dependency (and even sub-sub-dependency) is a great thing IMO, as not only does it show what we install.. but also what VERSION we should be using. Of course this's mainly used as a setup file. You run pip install -r requirements.txt, and you're off to the races!

If you want to update or add a new package (which may or may not require dependencies).. you can search online on how to properly update this file, I've done it with the most simple & straight forward way.. which's uninstalling every package, clearing the cache, and then install the packages required to build & deploy the docs website, see PR description for more details on the steps, and which "main" packages I've installed, which'll generate a similar list like the one below.

Copy link
Owner

@ChrisTitusTech ChrisTitusTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A great idea so dependabot doesn't screw us on a bad update. Thanks @og-mrk

@ChrisTitusTech ChrisTitusTech merged commit 723e1a1 into ChrisTitusTech:main Aug 9, 2024
1 check passed
@og-mrk og-mrk deleted the update-workflow/github-pages branch August 20, 2024 13:44
@ChrisTitusTech ChrisTitusTech added the skip-changelog Skip Change Logs label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skip Change Logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub Pages Workflow Shows a Warning on the Caching Step
2 participants