Skip to content

Commit 032a46c

Browse files
Merge pull request #26 from microsoft/psl-test
ci: added github actions
2 parents ab5ac24 + 78ca859 commit 032a46c

File tree

14 files changed

+300
-6
lines changed

14 files changed

+300
-6
lines changed

.coverage

52 KB
Binary file not shown.

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E501
4+
exclude = .venv, frontend
5+
ignore = E203, W503, G004, G200

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in the repo.
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @aniaroramsft

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions dependencies
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
commit-message:
9+
prefix: "build"
10+
target-branch: "dependabotchanges"
11+
open-pull-requests-limit: 100
12+
13+
14+
- package-ecosystem: "pip"
15+
directory: "/src/ContentProcessorAPI"
16+
schedule:
17+
interval: "monthly"
18+
commit-message:
19+
prefix: "build"
20+
target-branch: "dependabotchanges"
21+
open-pull-requests-limit: 100
22+
23+
24+
25+
26+
- package-ecosystem: "npm"
27+
directory: "/src/ContentProcessorWeb"
28+
schedule:
29+
interval: "monthly"
30+
commit-message:
31+
prefix: "build"
32+
target-branch: "dependabotchanges"
33+
open-pull-requests-limit: 100
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "PR Title Checker"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
merge_group:
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
main:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
if: ${{ github.event_name != 'merge_group' }}
19+
steps:
20+
- uses: amannn/action-semantic-pull-request@v5
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pylint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PyLint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.11"]
11+
steps:
12+
# Step 1: Checkout code
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
# Step 2: Set up Python environment
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
# Step 3: Install dependencies
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r src/ContentProcessorAPI/requirements.txt
27+
pip install flake8 # Ensure flake8 is installed
28+
29+
30+
# Step 4: Run all code quality checks
31+
- name: Pylint
32+
run: |
33+
echo "Running Pylint..."
34+
python -m flake8 --config=.flake8 --verbose .

.github/workflows/stale-bot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
permissions:
7+
contents: write
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
stale:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/stale@v9
16+
with:
17+
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
18+
days-before-stale: 180
19+
days-before-close: 30

.github/workflows/test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Test Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- demo
9+
pull_request:
10+
types:
11+
- opened
12+
- ready_for_review
13+
- reopened
14+
- synchronize
15+
branches:
16+
- main
17+
- dev
18+
- demo
19+
20+
jobs:
21+
backend_tests:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: "3.11"
32+
33+
- name: Install Backend Dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r src/ContentProcessorAPI/requirements.txt
37+
pip install pytest-cov
38+
pip install pytest-asyncio
39+
40+
- name: Set PYTHONPATH
41+
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV
42+
43+
- name: Check if Backend Test Files Exist
44+
id: check_backend_tests
45+
run: |
46+
if [ -z "$(find src/ContentProcessorAPI/app/tests -type f -name 'test_*.py')" ]; then
47+
echo "No backend test files found, skipping backend tests."
48+
echo "skip_backend_tests=true" >> $GITHUB_ENV
49+
else
50+
echo "Backend test files found, running tests."
51+
echo "skip_backend_tests=false" >> $GITHUB_ENV
52+
fi
53+
54+
- name: Run Backend Tests with Coverage
55+
if: env.skip_backend_tests == 'false'
56+
run: |
57+
pytest src/ContentProcessorAPI/app/tests
58+
pytest --cov=. --cov-report=term-missing --cov-report=xml
59+
60+
- name: Skip Backend Tests
61+
if: env.skip_backend_tests == 'true'
62+
run: echo "Skipping backend tests because no test files were found."
63+
64+
# frontend_tests:
65+
# runs-on: ubuntu-latest
66+
#
67+
# steps:
68+
# - name: Checkout code
69+
# uses: actions/checkout@v3
70+
#
71+
# - name: Set up Node.js
72+
# uses: actions/setup-node@v3
73+
# with:
74+
# node-version: "20"

coverage.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" ?>
2+
<coverage version="7.8.0" timestamp="1744254318592" lines-valid="32" lines-covered="30" line-rate="0.9375" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
3+
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.8.0 -->
4+
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
5+
<sources>
6+
<source>C:\Users\v-knagshetti\source\repos\main_content\content-processing-solution-accelerator</source>
7+
</sources>
8+
<packages>
9+
<package name="src.ContentProcessorAPI.app" line-rate="1" branch-rate="0" complexity="0">
10+
<classes>
11+
<class name="__init__.py" filename="src/ContentProcessorAPI/app/__init__.py" complexity="0" line-rate="1" branch-rate="0">
12+
<methods/>
13+
<lines/>
14+
</class>
15+
<class name="dependencies.py" filename="src/ContentProcessorAPI/app/dependencies.py" complexity="0" line-rate="1" branch-rate="0">
16+
<methods/>
17+
<lines>
18+
<line number="4" hits="1"/>
19+
<line number="6" hits="1"/>
20+
<line number="10" hits="1"/>
21+
<line number="12" hits="1"/>
22+
<line number="13" hits="1"/>
23+
<line number="17" hits="1"/>
24+
<line number="19" hits="1"/>
25+
<line number="20" hits="1"/>
26+
</lines>
27+
</class>
28+
</classes>
29+
</package>
30+
<package name="src.ContentProcessorAPI.app.tests" line-rate="0.9167" branch-rate="0" complexity="0">
31+
<classes>
32+
<class name="test_dependencies.py" filename="src/ContentProcessorAPI/app/tests/test_dependencies.py" complexity="0" line-rate="0.9167" branch-rate="0">
33+
<methods/>
34+
<lines>
35+
<line number="1" hits="1"/>
36+
<line number="2" hits="1"/>
37+
<line number="3" hits="1"/>
38+
<line number="4" hits="1"/>
39+
<line number="8" hits="1"/>
40+
<line number="9" hits="1"/>
41+
<line number="10" hits="1"/>
42+
<line number="12" hits="1"/>
43+
<line number="13" hits="1"/>
44+
<line number="14" hits="0"/>
45+
<line number="16" hits="1"/>
46+
<line number="17" hits="1"/>
47+
<line number="18" hits="0"/>
48+
<line number="20" hits="1"/>
49+
<line number="23" hits="1"/>
50+
<line number="24" hits="1"/>
51+
<line number="26" hits="1"/>
52+
<line number="27" hits="1"/>
53+
<line number="28" hits="1"/>
54+
<line number="31" hits="1"/>
55+
<line number="32" hits="1"/>
56+
<line number="34" hits="1"/>
57+
<line number="35" hits="1"/>
58+
<line number="36" hits="1"/>
59+
</lines>
60+
</class>
61+
</classes>
62+
</package>
63+
</packages>
64+
</coverage>

src/ContentProcessor/src/libs/pipeline/handlers/logics/evaluate_handler/comparison.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, List, Optional
22

33
import pandas as pd
4-
from pydantic import BaseModel, Field
4+
from pydantic import BaseModel
55

66
from libs.utils.utils import flatten_dict
77

0 commit comments

Comments
 (0)