Skip to content

Conversation

@marionbarker
Copy link
Collaborator

@marionbarker marionbarker commented Oct 23, 2025

Purpose

After thinking about it a bit more, there are more improvements that can be made to the GitHub actions build process than were included in PR #477.

Because there are no alive branches to consider, there is no reason to limit the sync to upstream to only work with main and dev. This way someone testing a special branch can run the build process and have that special branch pick up updates from the upstream repository.

This PR only affects the build yml file. The redesign from this PR and PR 477 can be replicated in other open source apps.

Method

Rules of Thumb

  • Use as few runners as possible and when possible, choose ubuntu
  • Move processes later in the the process if they are not needed earlier
  • Configure to skip a process if it will not be used

For example, by moving check_certs later in the process and skipping it when build will be skipped, decreases the number of runners significantly for the weekly runs that do not trigger a build

Details

There are 3 main jobs:

  • check_status: contains all processes that can be run with ubuntu in a sequential line
  • check_certs: skipped if the logic indicates a build will be skipped
  • build: skipped if the logic indicates a build will be skipped

The biggest change is to check_status.

  • This is now in one ubuntu runner with this order of processes

Edited this next section after updating for the following reasons (and modifying a few names):

  • @bjorkert pointed out a syntax error - GitHub was smart enough to do the right thing, but corrected the error
  • I tested having an incorrect GH_PAT and did not get a nice error message
    • I copied the GH_PAT checking code from validate_secrets
    • Unless you are going to build (in which case you call create_certs that calls validate_secrets), the other secrets do not need to be checked

name: Check status to decide whether to build
- name: Access
- name: Checkout target repo
- name: Sync upstream changes
- name: New commits found
- name: No new commits
- name: Show value of 'has_new_commits'
- name: Show scheduled build configuration message
- name: Check if this is the second time this day-of-week happens this month

* allow any target branch to sync with upstream branch of the same name
* minimize the number of runners
* only run create certs if a build is planned
@marionbarker
Copy link
Collaborator Author

marionbarker commented Oct 23, 2025

Test

This was developed and tested similar to PR 477.

Scheduled action with build skipped

The top graphic is from the design prior to the changes found in PR 477. The bottom graphic shows the new design with this PR as well as PR 477.

I know that the time a GitHub action takes can vary, but in this case the speed up to 16s from 1m 48s is significant. Plus only one ubuntu runner is used instead of several runners (ubuntu and macos).

scheduled-skip-compare

Scheduled action with build

The top graphic is from the design prior to the changes found in PR 477. The bottom graphic shows the new design with this PR as well as PR 477.

I don't expect a lot of difference here - except for how busy GitHub is and how long it takes to get a runner.

  • The time it takes to do 2 sync upstream steps ("old") instead of 1 sync upstream ("new") is just a few seconds.
  • The reduction in number of runners ("new") and shift to ubuntu where possible will only help.
scheduled-build-compare

@marionbarker
Copy link
Collaborator Author

marionbarker commented Oct 23, 2025

Test

Repeat a few scheduled tests with the final version.
All tests passed. LGTM.

Test Details

Start with the final commit of this PR and make a new branch, schedule_tests, to push to marionbarker and docs-test. Modify the upstream to marionbarker and adjust the cron to enable these schedule tests.

Time differences between 2 scheduled builds are not significant - it's the same processes just on different runners.

Expect to skip certs and skip build

Expect to build because of upstream commit

Expect to build - because of 4th Thursday (both repos at same commit)

@marionbarker marionbarker merged commit 2711a2d into dev Oct 23, 2025
@marionbarker marionbarker deleted the cleanup_and_sync_any_branch branch October 23, 2025 22:52
@marionbarker
Copy link
Collaborator Author

marionbarker commented Oct 25, 2025

Comment - I renamed LoopFollow in docs-test to LoopFollow_fork_from_mdb so that docs-test LoopFollow that is forked from loopandlearn can be restored to the name of LoopFollow.

I updated the links in this PR to the new fork name so they continue to work.

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.

3 participants