Skip to content

Commit

Permalink
simple CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
yeabmoh committed Nov 13, 2024
1 parent ef84570 commit 643fd95
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI on Merge to Main

on:
push:
branches:
- main # Triggers when code is pushed to the main branch
- ms4

jobs:
test:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Python environment (specifically Python 3.12)
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

# Step 2.1: Set PYTHONPATH to include the root directory (or src if relevant)
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)" >> $GITHUB_ENV # Adds current directory to PYTHONPATH


# Step 3: Install pytest and pytest-cov for coverage
- name: Install pytest and pytest-cov
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
# Step 4: Run pytest with coverage and generate HTML report
- name: Run tests with coverage
run: |
pytest --cov=. --cov-report=html
# Step 5: Upload coverage report as an artifact
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: htmlcov # The folder where pytest-cov stores HTML reports
Binary file removed apple.pdf
Binary file not shown.

0 comments on commit 643fd95

Please sign in to comment.