Skip to content

Update README.md

Update README.md #8

# Name of the workflow
name: Error CI Pipeline
# This workflow is designed to test the test_script_error.py, which intentionally contains errors.
# This allows us to verify how the CI/CD pipeline handles test failures.
# Define the events that trigger the workflow
on:
# Trigger the workflow on pushes to the 'main' branch
push:
branches:
- main
# Trigger the workflow on pull requests targeting the 'main' branch
pull_request:
branches:
- main
# Define the jobs that will run as part of this workflow
jobs:
build:
# Specify the operating system for the job
runs-on: ubuntu-latest
# Define the steps to execute in this job
steps:
# Step 1: Checkout the code from the repository
- name: Checkout Code
uses: actions/checkout@v2
# This action checks out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
# Step 2: Set up the Python environment
- name: Set Up Python Environment
uses: actions/setup-python@v2
with:
# Specify the version of Python to use for the environment
python-version: "3.9" # Replace with your desired Python version
# Step 3: Install project dependencies
- name: Install Project Dependencies
run: |
# Upgrade pip to ensure we have the latest package management tools
python -m pip install --upgrade pip
# Install pytest, a testing framework that we'll use to run our test scripts
pip install pytest
# Step 4: Execute tests using pytest
- name: Run Tests
run: |
# Execute the tests defined in the test_script_error.py script.
# This script is expected to have errors, allowing us to verify the CI's error handling.
pytest test_script_error.py # Run tests in the specified test script