Skip to content

Commit f39599a

Browse files
added codecov code for showing statistics
1 parent bf48b6a commit f39599a

File tree

1 file changed

+84
-68
lines changed

1 file changed

+84
-68
lines changed

.github/workflows/pull-request.yml

Lines changed: 84 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
run: |
2828
echo "Pull requests are only allowed against the 'develop-postgres' branch. Please refer to the pull request guidelines."
2929
echo "Error: Close this PR and try again."
30-
exit 1
31-
30+
exit 1
31+
3232
Code-Quality-Checks:
3333
name: Checking code quality
3434
runs-on: ubuntu-latest
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: Run Python script
8888
run: |
89-
python .github/workflows/scripts/code_coverage_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }}
89+
python .github/workflows/scripts/code_coverage_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }}
9090
9191
check_gql_tada:
9292
name: Check gql tada files and configuration
@@ -98,7 +98,7 @@ jobs:
9898
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./
9999
- name: Check gql tada
100100
run: docker container run talawa_api pnpm check_gql_tada
101-
101+
102102
check_drizzle_migrations:
103103
name: Check drizzle migration files
104104
runs-on: ubuntu-latest
@@ -109,7 +109,7 @@ jobs:
109109
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./
110110
- name: Check drizzle migrations
111111
run: docker container run --env-file ./envFiles/.env.ci talawa_api pnpm check_drizzle_migrations
112-
112+
113113
check_type_errors:
114114
name: Check type errors
115115
runs-on: ubuntu-latest
@@ -127,71 +127,73 @@ jobs:
127127
needs: [Code-Quality-Checks]
128128
runs-on: ubuntu-latest
129129
steps:
130-
- name: Checkout this repository
131-
uses: actions/[email protected]
132-
- id: changed_files
133-
name: Get changed files
134-
uses: tj-actions/[email protected]
135-
with:
136-
files: |
137-
.coderabbit.yaml
138-
Caddyfile
139-
codegen.ts
140-
Dockerfile*
141-
docker-compose*
142-
.dockerignore
143-
.env.sample
144-
.env_test
145-
eslint.config.mjs
146-
envFiles/**
147-
.gitignore
148-
init-mongo.sh
149-
.prettierignore
150-
.prettierrc.json
151-
.pylintrc
152-
.github/**
153-
biome.jsonc
154-
drizzle_migrations/**
155-
renovate.json
156-
requirements.txt
157-
schema.graphql
158-
CODEOWNERS
159-
LICENSE
160-
tsconfig.json
161-
vitest.config.ts
162-
pnpm-lock.yaml
163-
package.json
164-
package-lock.json
165-
.nojekyll
166-
docs/docusaurus.config.ts
167-
docs/sidebar*
168-
setup.ts
169-
tsconfig.build.json
170-
vite.config.mts
171-
CNAME
172-
CODE_OF_CONDUCT.md
173-
CODE_STYLE.md
174-
CONTRIBUTING.md
175-
DOCUMENTATION.md
176-
INSTALLATION.md
177-
ISSUE_GUIDELINES.md
178-
PR_GUIDELINES.md
179-
README.md
180-
- env:
181-
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
182-
if: steps.changed_files.outputs.any_changed == 'true' || steps.changed_files.outputs.any_deleted == 'true'
183-
name: Show changed files
184-
run: |
185-
echo "Unauthorized changes were made in the following files:"
186-
for FILE in ${CHANGED_FILES}; do
187-
echo "$FILE"
188-
done
189-
echo "To override this, apply the 'ignore-sensitive-files-pr' label"
190-
exit 1
191-
130+
- name: Checkout this repository
131+
uses: actions/[email protected]
132+
- id: changed_files
133+
name: Get changed files
134+
uses: tj-actions/[email protected]
135+
with:
136+
files: |
137+
.coderabbit.yaml
138+
Caddyfile
139+
codegen.ts
140+
Dockerfile*
141+
docker-compose*
142+
.dockerignore
143+
.env.sample
144+
.env_test
145+
eslint.config.mjs
146+
envFiles/**
147+
.gitignore
148+
init-mongo.sh
149+
.prettierignore
150+
.prettierrc.json
151+
.pylintrc
152+
.github/**
153+
biome.jsonc
154+
drizzle_migrations/**
155+
renovate.json
156+
requirements.txt
157+
schema.graphql
158+
CODEOWNERS
159+
LICENSE
160+
tsconfig.json
161+
vitest.config.ts
162+
pnpm-lock.yaml
163+
package.json
164+
package-lock.json
165+
.nojekyll
166+
docs/docusaurus.config.ts
167+
docs/sidebar*
168+
setup.ts
169+
tsconfig.build.json
170+
vite.config.mts
171+
CNAME
172+
CODE_OF_CONDUCT.md
173+
CODE_STYLE.md
174+
CONTRIBUTING.md
175+
DOCUMENTATION.md
176+
INSTALLATION.md
177+
ISSUE_GUIDELINES.md
178+
PR_GUIDELINES.md
179+
README.md
180+
- env:
181+
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
182+
if: steps.changed_files.outputs.any_changed == 'true' || steps.changed_files.outputs.any_deleted == 'true'
183+
name: Show changed files
184+
run: |
185+
echo "Unauthorized changes were made in the following files:"
186+
for FILE in ${CHANGED_FILES}; do
187+
echo "$FILE"
188+
done
189+
echo "To override this, apply the 'ignore-sensitive-files-pr' label"
190+
exit 1
191+
192192
Run-Tests:
193193
name: Run tests for talawa api
194194
runs-on: ubuntu-latest
195+
needs:
196+
[Code-Quality-Checks, Check-ESlint-Disable, Check-Code-Coverage-Disable]
195197
steps:
196198
- name: Checkout this repository
197199
uses: actions/[email protected]
@@ -201,12 +203,25 @@ jobs:
201203
run: docker compose build
202204
- name: Run tests
203205
run: docker compose up --exit-code-from api
206+
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
207+
uses: codecov/codecov-action@v4
208+
with:
209+
verbose: true
210+
token: ${{ secrets.CODECOV_TOKEN }}
211+
fail_ci_if_error: false
212+
name: "${{env.CODECOV_UNIQUE_NAME}}"
213+
214+
- name: Test acceptable level of code coverage
215+
uses: VeryGoodOpenSource/very_good_coverage@v2
216+
with:
217+
path: "./coverage/lcov.info"
218+
min_coverage: 95.0
204219

205220
Test-Docusaurus-Deployment:
206221
name: Test Deployment to https://docs-api.talawa.io
207222
runs-on: ubuntu-latest
208223
needs: [Run-Tests]
209-
# Run only if the develop-postgres branch and not dependabot
224+
# Run only if the develop-postgres branch and not dependabot
210225
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
211226
steps:
212227
- uses: actions/checkout@v4
@@ -290,3 +305,4 @@ jobs:
290305
run: |
291306
source venv/bin/activate
292307
python .github/workflows/scripts/check_docstrings.py --directories .github
308+

0 commit comments

Comments
 (0)