This is a repo for building out Github Actions and Tricks. I test multiple clouds and multiple versions of Python.
Create a virtualenv
python3 -m venv ~/.github-actions-demo
Source it
source ~/.github-actions-demo/bin/activate
- Fork the GitHub repo
- Local steps:
- Check out the forked repo
- Review code
- Run Makefile - install, lint, test
- Confirm everything works locally
- Setup GitHub Actions to install, lint, and test
- Setup AWS CloudShell
- Connect to GitHub repo
- Automatically build when the repo changes
- Validate its working
- Setup GCP CloudShell
- Connect to GitHub repo
- Automatically build when the repo changes
- Validate its working
- Setup Azure CloudShell
- Connect to GitHub repo
- Automatically build when the repo changes
- Validate its working
- Confirm that code changes update all three cloud environemtns
- Document process in GitHub with a README.md that describes what the project does
- Create a Demo Video and reference it in your GitHub Project.
GitHub:
- forked the repo into https://github.com/werthds-io/multi-cloud-exercise
Local:
- Cloned the repo
- Set up venv
- Reviewed code - very simple app and test script, has Makefile with requirements files for default, aws, and gcp
- Run make install, lint, format, test
- everything ran as expected, no issues
- Ran hello.py - confirmed that 1 plus 1 equals 2
- Review workflows in .github/workflows
- Azure - main.yml On “push” it sets up a python3.6 env and runs install, link, and test
- GCP - gcp.yml On “push” it sets up a python3.7 env and runs install-gcp, link, and test
- AWS - aws.yml On “push” it sets up a python3.6 env and runs install-aws
- AWS-Linux2 - aws-linux2.yml On “push” it sets up a python3.7.9 env and runs install-amazon-linux, link, test, and format
Setup GitHub Actions:
- Opened actions in GitHub and disabled all workflows except Azure Python 3.6
Azure Cloud Shell:
- Cloned the GitHub multi-cloud-exercise repo
- Setup venv .venv and activated it
- Ran make install, lint, format, and test
- The format failed because black wasn’t in requirmeents.txt—it didn’t update. Formatting isn’t required for cloud environments as long as it’s on local.
- Everything else ran as expected.
GitHub Actions:
- Made a code change to trigger the workflow
- Failed due to only version of python - updated workflow to python 3.12.2
- Changed the workflow to python 3.12.2 and pushed the change
- Workflow ran without errors
AWS Cloud Shell
- Cloned the GitHub multi-cloud-exercise repo
- Setup venv .venv and activated it
- Ran make install, lint, and test
- Everything ran as expected.
GitHub Actions:
- Made a code change to trigger the workflow
- Failed due to only version of python - updated workflow to python 3.12.2
- Changed the workflow to python 3.12.2 and pushed the change
- Workflow ran without errors
GCP Cloud Shell:
- Cloned the GitHub multi-cloud-exercise repo
- Setup venv .venv and activated it
- Ran make install-gcp, lint, and test
- Everything ran as expected.