Automate running PyTest tests in GitHub Actions
Preconditions (2)
Step 1: Create a .github/workflows/python-test.yml file in the repository
Step 2: Define a workflow that triggers on push and pull request events
Step 3: Set up a job that runs on ubuntu-latest
Step 4: Add steps to check out the repository code
Step 5: Add a step to set up Python 3.12
Step 6: Add a step to install dependencies from requirements.txt
Step 7: Add a step to run pytest command
Step 8: Push the workflow file to the repository
✅ Expected Result: GitHub Actions runs the workflow on push or pull request, installs dependencies, runs pytest tests, and reports test results as pass or fail in the Actions tab