Skip to content

add first attempt at page building tests for CI - #361

Open
gonuke wants to merge 10 commits into
cnerg:mainfrom
gonuke:ci-testing
Open

add first attempt at page building tests for CI#361
gonuke wants to merge 10 commits into
cnerg:mainfrom
gonuke:ci-testing

Conversation

@gonuke

@gonuke gonuke commented Aug 24, 2026

Copy link
Copy Markdown
Member

Add a CI workflow that builds the pages and saves them as an artifact that is a ZIP file of the full built site. That artifact can be downloaded, unpacked and served locally (python3 -m http.server) and then reviewed on a local port.

The artifact is found by clicking on the test, navigating the the test "Summary" and scrolling down.

@@ -0,0 +1,19 @@
name: Build Jekyll site
on:
pull_request:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am used to limiting this to specific branches. However, if you aren't deploying anything I think that won't be necessary here.

pull_request:
workflow_dispatch:

jobs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Best practice is to be explicit with the permissions:

Suggested change
jobs:
jobs:
permissions:
contents: read

This is probably not essentially, but does protect against GH changing default permissions in the future. reference


steps:
- name: Checkout
uses: actions/checkout@v7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

More of an FYI: this style of version specification is being discouraged for security nowadays. This is because version numbers on GH actions are not immutable, and could be maliciously changed/released. The workaround is to specific full git SHAs.

However, this is very tedious to keep up with, and really necessitates dependabot managing actions. Given that these are all 'actions` maintained I think the risk of a malicious release is rather low, so I think in this case it's fine as is. Just an FYI. Reference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@magnoxemo magnoxemo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we also update the README.md with the new build instructions (downloading the artifact and building it locally using python)? We can keep the Docker option for folks who want to build it locally first and then open a PR.

@MicahGale

Copy link
Copy Markdown
Contributor

Should we also update the README.md with the new build instructions (downloading the artifact and building it locally using python)? We can keep the Docker option for folks who want to build it locally first and then open a PR.

Not necessarily, being able to build locally is still helpful, and how it ought to be done for large updates.

@gonuke

gonuke commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

Should we also update the README.md with the new build instructions (downloading the artifact and building it locally using python)? We can keep the Docker option for folks who want to build it locally first and then open a PR.

Not necessarily, being able to build locally is still helpful, and how it ought to be done for large updates.

I think we should add something to the README, but leave the previous info as @MicahGale suggested

@lewisgross1296 lewisgross1296 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not the most familiar with GitHub Actions, but my only thought is it would be nice to test that this works before merging, but it seems like a chicken and egg game where we can't test new PRs with this until it's merged. I think once people are happy with this, we can merge, test, and make additional PRs as needed.

Also, would be cool to have a bot that auto comments the built link like how https://github.com/moosebuild does for docs/coverage/etc.

@gonuke

gonuke commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

I'm not the most familiar with GitHub Actions, but my only thought is it would be nice to test that this works before merging, but it seems like a chicken and egg game where we can't test new PRs with this until it's merged. I think once people are happy with this, we can merge, test, and make additional PRs as needed.

The test that was run on this PR demonstrates it

@gonuke

gonuke commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

Also, would be cool to have a bot that auto comments the built link like how https://github.com/moosebuild does for docs/coverage/etc.

I am looking for a way to post a link to the artifact in the comments to make it easier to find

@lewisgross1296

Copy link
Copy Markdown
Contributor

The artifact is found by clicking on the test, navigating the the test "Summary" and scrolling down.

Yeah, I'm looking at the test Summary but is the Expired where you're supposed to be able to download from?
Screenshot 2026-08-25 at 4 16 57 PM

@gonuke

gonuke commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

The artifact is found by clicking on the test, navigating the the test "Summary" and scrolling down.

Yeah, I'm looking at the test Summary but is the Expired where you're supposed to be able to download from?

Hmmmm.... maybe I need to set the time that it is saved

@MicahGale

Copy link
Copy Markdown
Contributor

The artifact is found by clicking on the test, navigating the the test "Summary" and scrolling down.

Yeah, I'm looking at the test Summary but is the Expired where you're supposed to be able to download from?

Hmmmm.... maybe I need to set the time that it is saved

You can change this in repo settings outside the workflow. Maybe 30 days would be good? https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization

gonuke added 5 commits August 27, 2026 07:28
Added retention policy for uploaded artifacts. This action overrides the organization default (currently 90)
Added section on CI testing of file rendering with instructions for viewing artifacts.
Add a link to the artifact in the comments
Added permissions for contents and pull-requests in build job. Removed link job and integrated its step into build.
This action is deprecated/uses deprecated code… many similar actions seem to have the same problem.
Comment thread README.md

When a pull request (PR) is submitted for this repository, an action will automatically attempt to build the
pages and upload an artifact of that process as part of the test, named `github-pages`. The artifact can be
found by viewing the results of the test, clicking on the “Summary” and scrolling to the bottom of the page.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Another option maybe? with out scrolling through CI summary.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants