-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update 'github-pages.yaml' Workflow - Fix several warnings & enable Caching pip packages #2539
Conversation
…aching pip packages
…le in 'github-pages.yaml' Workflow
…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 |
There was a problem hiding this comment.
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.
- dependency-name: "actions/setup-python" | ||
versions: '> 4' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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
Type of Change
Description
This PR Makes
github-pages.yaml
Workflow more maintainable/readable, also makesgit-revision-date-localized-plugin
plugin work by pull all commit history (see references for more info), and makegithub-pages.yaml
generate no warnings*..Except forFixed in this commit, see my review comments on why I've updated this action.nodejs
warning, which can be resolved by updatingactions/setup-python
tov5
.. but it can't be done at the moment, as it's pinned to usev4
or less. The reason behind this version pinning is unclear...Nonetheless, these changes should make
github-pages.yaml
workflow cache the results (downloads) of pip packages, and these packages are specified in the newrequirements.txt
file, which's a common file used in Python Environments, which specifies every package to install, and what version to use, usingPackageName==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