After testing the newly generated project has passed, we need a job to generate the Mason bundles, then commit and push in cases there're any changes.
This PR is to create that automated job of the CI workflow.
Insight 📝
According to the requirement, we should create a new workflow (generate_mason_bundle.yml). However, if we create a brand new workflow, we will need to use the workflow_dispatch to trigger the generate_mason_bundle.yml workflow inside the test.yml workflow. That approach still resolves our issue, but it will be overused in this case.
According to this document, I think we just need to define a new job named generate_mason_bundle inside the test.yml workflow:
A workflow run is made up of one or more jobs, which run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs.<job_id>.needs keyword.
So technically, I think the approach for this task in the test.yml file is that:
...
jobs:
test:
...
generate_mason_bundle:
# The job generate_mason_bundle identify that the job test must complete successfully
# before this generate_mason_bundle job will run
needs: test
...
Proof Of Work 📹
When the Mason bundle does NOT have changes
Template initializing scripts test had completed then Generate Mason bundle started.
Skip the step Commit & push the sample project changes
When the Mason bundle has changes
Template initializing scripts test had completed then Generate Mason bundle started.
Run the step Commit & push the sample project changes
What happened 👀
After testing the newly generated project has passed, we need a job to generate the Mason bundles, then commit and push in cases there're any changes.
This PR is to create that automated job of the CI workflow.
Insight 📝
According to the requirement, we should create a new workflow (
generate_mason_bundle.yml
). However, if we create a brand new workflow, we will need to use theworkflow_dispatch
to trigger thegenerate_mason_bundle.yml
workflow inside thetest.yml
workflow. That approach still resolves our issue, but it will be overused in this case.According to this document, I think we just need to define a new job named
generate_mason_bundle
inside thetest.yml
workflow:So technically, I think the approach for this task in the
test.yml
file is that:Proof Of Work 📹
When the Mason bundle does NOT have changes
Template initializing scripts test
had completed thenGenerate Mason bundle
started.Commit & push the sample project changes
When the Mason bundle has changes
Template initializing scripts test
had completed thenGenerate Mason bundle
started.Commit & push the sample project changes