Your team wants to learn how to automate and orchestrate common tasks such as environment setup, training, testing using GitHub Actions. To accomplish this, the following steps will be performed:
- Setup a centralized version control to keep track of project code and manage different feature development tracks and releases
- Learn how to automate and orchestrate common tasks such as environment setup, training, testing by setting up a unit test workflow to run when code is updated in your branch
-
Move to your dev branch you created in step 1 if you are not already there.
Action Items:
- Navigate to the repo if not already there by running
cd PATH_TO_REPOwith the proper path to the cloned location. - Run following command to check out your "yourname-dev"
git checkout yourname-dev
- Navigate to the repo if not already there by running
-
Create an automated unit test task that will be triggered by pushing the code to your development/feature branch. Let's use the
Feature_Engineeringmodule as the automated unit test to run to make sure the module performs correctly.Action Items: Update the
workshop_unit_test.ymlfile with your secret credentials. Replace the resource group, workspace and location with your specific details.- Locate the file named
workshop_unit_test.ymlin the.github/workflowsfolder - Make the following updates to the file:
- Update the secret name by replacing the
AZURE_SERVICE_PRINCIPALto match the GitHub secret name for your Service Principal that was created in Part 0. (If you followed the naming convention in part 0, there is no need to update this as your secret name should beAZURE_SERVICE_PRINCIPAL.) - Update
GROUP,NAME, andLOCATIONwith the specific names of your resource group, workspace, and location created in Part 0.
- Update the secret name by replacing the
- Locate the file named
-
Next, review the contents in the
workshop_unit_test.ymlfile to understand the steps and how it is being triggered.- Review the trigger defined in the
on:section to see how this workflow is being run automatically- The
workflow_dispatchallows the workflow to be run manually which can be useful when testing. - The remaining lines highlight what is going to automatically trigger the workflow. It is being triggered on a push to any branch that is not
mainorintegration. The changes in the push are also filtered to only include changes made to thefeature_engineeringmodule.
- The
- Review the job starting at the
jobs:section that has been created already and does the following steps:- Checks out the repo
- Logs into Azure
- Creates an AML job to run feature engineering module using the custom action and the existing feature engineering job file
- Review the trigger defined in the
-
Now that the necessary changes have been made, the changes can be pushed to your feature branch which will trigger the feature_engineering_unit_test workflow.
Action Items:
- Run the following commands in sequence to stage changes, commit them, and then push them to your repo:
-
git status
-
git add . -
git commit -am "configurations update" -
git push origin yourname-dev
Note:
git statusshows the files that have been modified. It is useful for seeing the latest status of the files, but isn't necessary to commit changes.
- Check to see if the workflow was properly triggered by going to your github repo and selecting the Actions tab.
- A feature or development branch was created to track your changes
- Trigger was created on the workflow file
workshop_unit_test.ymlto run on a push to your feature branch - Understand the additional updates that were made to
feature_engineering.ymlfile for it to use your secrets and AML resources - Workflow was successfully triggered by pushing changes to your feature branch
