Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
55bedaa
edit 1
Dec 25, 2024
619afa9
edit 2
Dec 25, 2024
38aaf58
Repository Governance
Dec 30, 2024
3fe801b
added stale-bot
Dec 30, 2024
7e7b72e
stalebot test
Dec 30, 2024
5a676da
chNGED TO 1 DAY
Dec 30, 2024
d20ffde
edit 3
Dec 30, 2024
9b55d1a
Merge branch 'main' of https://github.com/Harmanpreet-Microsoft/Multi…
Jan 1, 2025
5e568d8
Create test
Harmanpreet-Microsoft Jan 1, 2025
3eb8010
edit1
Jan 1, 2025
8b1298f
edit2
Jan 1, 2025
683c4a9
edit 4
Jan 1, 2025
8ebaa51
edit 5
Jan 1, 2025
801d6eb
edit 6
Jan 1, 2025
1c845fa
edit 6
Jan 1, 2025
82446b2
edit 7
Jan 1, 2025
a9f989f
edit 8
Jan 1, 2025
3e31574
edit 5
Jan 1, 2025
805a8ba
edit 10
Jan 1, 2025
ab4c4c5
edit 11
Jan 1, 2025
7a5dbb4
edit 12
Jan 1, 2025
a32fb8d
edit 13
Jan 1, 2025
bec99d7
Update stale-bot.yml
Harmanpreet-Microsoft Jan 1, 2025
df179d1
edit 14
Jan 2, 2025
d755232
Merge branch 'main' of https://github.com/Harmanpreet-Microsoft/Multi…
Jan 2, 2025
955eb5b
edit 15
Jan 2, 2025
bc48275
edit 16
Jan 2, 2025
e47008f
edit 17
Jan 2, 2025
6a56c07
Update stale-bot.yml
Harmanpreet-Microsoft Jan 3, 2025
5905679
Update CODEOWNER
Harmanpreet-Microsoft Jan 3, 2025
40dfc88
Create nwetest
Harmanpreet-Microsoft Jan 3, 2025
07e1d4e
added pylint
Jan 7, 2025
06f1c2f
Merge branch 'main' of https://github.com/Harmanpreet-Microsoft/Multi…
Jan 7, 2025
9222555
changed flak loc
Jan 7, 2025
bc4e843
edit 1
Jan 7, 2025
7ddb489
add backend test workflow
Jan 7, 2025
aceb522
added test file
Jan 8, 2025
47b3741
edit 2
Jan 8, 2025
950d330
added sample test file
Jan 8, 2025
962b38b
changed py version
Jan 8, 2025
f31bf82
made edits to workflow
Jan 8, 2025
0fcbff4
pass even if test filesa r not present
Jan 8, 2025
4569e80
removed test file
Jan 8, 2025
c0a4dae
added sample test file
Jan 8, 2025
182db35
Create docker-build-and-push.yml
Harmanpreet-Microsoft Jan 14, 2025
d6afd6f
Merge pull request #1 from Harmanpreet-Microsoft/stale_bot_tset
Harmanpreet-Microsoft Jan 14, 2025
0bf1920
Merge pull request #4 from microsoft/main
Harmanpreet-Microsoft Jan 15, 2025
c754e9c
Delete test
Harmanpreet-Microsoft Jan 15, 2025
3109279
Delete src/backend/middleware/test_health_check.py
Harmanpreet-Microsoft Jan 15, 2025
23cd01f
Delete .github/nwetest
Harmanpreet-Microsoft Jan 15, 2025
a720e12
Delete .github/workflows/CI.yml
Harmanpreet-Microsoft Jan 15, 2025
7791bd8
updated docker
Jan 15, 2025
4a1ece9
Merge branch 'main' of https://github.com/Harmanpreet-Microsoft/Multi…
Jan 15, 2025
6d92760
Update test.yml
Harmanpreet-Microsoft Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 88
extend-ignore = E501
exclude = .venv, frontend
ignore = E203, W503, G004, G200
83 changes: 83 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
- dev
- demo
- hotfix
pull_request:
types:
- opened
- ready_for_review
- reopened
- synchronize
branches:
- main
- dev
- demo
- hotfix
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Azure Container Registry
if: ${{ github.ref_name == 'main' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Log in to Azure Container Registry (Dev/Demo)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
username: ${{ secrets.ACR_DEV_USERNAME }}
password: ${{ secrets.ACR_DEV_PASSWORD }}

- name: Set Docker image tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo "TAG=dev" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/demo" ]]; then
echo "TAG=demo" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/hotfix" ]]; then
echo "TAG=hotfix" >> $GITHUB_ENV
fi
- name: Build and push Docker images
if: ${{ github.ref_name == 'main' }}
run: |
cd src/backend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Backend image built and pushed successfully."
cd ../frontend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Frontend image built and pushed successfully."
- name: Build and push Docker images (Dev/Demo/hotfix)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
run: |
cd src/backend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Backend image built and pushed successfully."
cd ../frontend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Frontend image built and pushed successfully."

27 changes: 27 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pylint and Flake8

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/backend/requirements.txt
pip install flake8 # Ensure flake8 is installed explicitly

- name: Run flake8 and pylint
run: |
flake8 --config=.flake8 src/backend # Specify the directory to lint
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Test Workflow with Coverage

on:
push:
branches:
- main
- dev
- demo
- hotfix
pull_request:
types:
- opened
- ready_for_review
- reopened
- synchronize
branches:
- main
- main
- dev
- demo
- hotfix

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/backend/requirements.txt
pip install pytest-cov

- name: Check if test files exist
id: check_tests
run: |
if [ -z "$(find src -type f -name 'test_*.py')" ]; then
echo "No test files found, skipping tests."
echo "skip_tests=true" >> $GITHUB_ENV
else
echo "Test files found, running tests."
echo "skip_tests=false" >> $GITHUB_ENV
fi

- name: Run tests with coverage
if: env.skip_tests == 'false'
run: |
pytest --cov=. --cov-report=term-missing --cov-report=xml

- name: Skip coverage report if no tests
if: env.skip_tests == 'true'
run: |
echo "Skipping coverage report because no tests were found."
Loading