Skip to content

Commit

Permalink
Merge branch 'develop-postgres' into linux-systemd-service
Browse files Browse the repository at this point in the history
  • Loading branch information
sahitya-chandra authored Jan 14, 2025
2 parents be02982 + 197092f commit 3388e02
Show file tree
Hide file tree
Showing 88 changed files with 3,595 additions and 2,176 deletions.
1 change: 1 addition & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ reviews:
drafts: false
base_branches:
- develop
- develop-postgres
- main
chat:
auto_reply: true
7 changes: 6 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@
"package-lock.json",
"tsconfig.json",
"docs/**",
"examples/**"
"examples/**",
"docs/docusaurus.config.ts",
"docs/sidebars.ts",
"docs/src/**",
"docs/blog/**",
"pyproject.toml"
]
}
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = E402,E722,E203,F401,W503
max-line-length = 80
150 changes: 0 additions & 150 deletions .github/workflows/css_check.py

This file was deleted.

118 changes: 86 additions & 32 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ jobs:
chmod +x ./.github/workflows/scripts/countline.py
./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx
# Run the CSS import check script
- name: Check for CSS violations and print correct imports
run: |
if [ ! -f ./.github/workflows/css_check.py ]; then
echo "Error: CSS check script not found"
exit 1
fi
chmod +x ./.github/workflows/css_check.py
./.github/workflows/css_check.py --directory . || {
echo "Error: CSS check failed"
exit 1
}
- name: Get changed TypeScript files
id: changed-files
uses: tj-actions/changed-files@v45
Expand Down Expand Up @@ -109,6 +96,9 @@ jobs:
uses: tj-actions/changed-files@v45
with:
files: |
.flake8
.pydocstyle
pyproject.toml
.env*
vitest.config.js
src/App.tsx
Expand Down Expand Up @@ -255,27 +245,50 @@ jobs:
uses: tj-actions/changed-files@v45

- name: Run Jest Tests
if: steps.changed-files.outputs.only_changed != 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
NODE_V8_COVERAGE: './coverage/jest'
run: |
npm run test -- --watchAll=false --coverage
- name: Upload Jest Coverage to Codecov
if: steps.changed-files.outputs.any_changed == 'true'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/jest/lcov.info
flags: jest
fail_ci_if_error: true

- name: Run Vitest Tests
if: steps.changed-files.outputs.only_changed != 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
NODE_V8_COVERAGE: './coverage/vitest'
run: |
npm run test:vitest:coverage
- name: Merge Coverage Reports
if: steps.changed-files.outputs.only_changed != 'true'
- name: Upload Vitest Coverage to Codecov
if: steps.changed-files.outputs.any_changed == 'true'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/vitest/lcov.info
flags: vitest
fail_ci_if_error: true

- name: Merge Jest and Vitest Coverage Reports
run: |
mkdir -p coverage
if ! npx lcov-result-merger 'coverage/*/lcov.info' > 'coverage/lcov.info'; then
echo "Failed to merge coverage reports"
exit 1
fi
mkdir -p ./coverage
npx lcov-result-merger './coverage/*/lcov.info' './coverage/lcov.info'
- name: Upload Combined Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_ignore: 'docs/'
files: ./coverage/lcov.info
flags: combined
fail_ci_if_error: true

- name: TypeScript compilation for changed files
run: |
Expand All @@ -285,16 +298,6 @@ jobs:
fi
done
- name: Present and Upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
gcov_ignore: 'docs/'
fail_ci_if_error: false
files: './coverage/lcov.info'
name: '${{env.CODECOV_UNIQUE_NAME}}'

- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
Expand Down Expand Up @@ -462,3 +465,54 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}


Python-Compliance:
name: Check Python Code Style
runs-on: ubuntu-latest
needs: [Code-Quality-Checks]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r .github/workflows/requirements.txt
- name: Run Black Formatter Check
run: |
source venv/bin/activate
black --check .
- name: Run Flake8 Linter
run: |
source venv/bin/activate
flake8 --docstring-convention google --ignore E402,E722,E203,F401,W503 .github
- name: Run pydocstyle
run: |
source venv/bin/activate
pydocstyle --convention=google --add-ignore=D415,D205 .github
- name: Run docstring compliance check
run: |
source venv/bin/activate
python .github/workflows/scripts/check_docstrings.py --directories .github
2 changes: 1 addition & 1 deletion .github/workflows/push-deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Deploy https://docs-admin.talawa.io website
runs-on: ubuntu-latest
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
environment:
# This "name" has to be the repos' branch that contains
# the current active website. There must be an entry for
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#############################################################################
# DO NOT DELETE
#############################################################################
#
# Required for GitHub Action workflow python checks
#
#############################################################################
#############################################################################

black
pydocstyle
flake8
flake8-docstrings
docstring_parser
Loading

0 comments on commit 3388e02

Please sign in to comment.