Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
417 commits
Select commit Hold shift + click to select a range
7fee22a
ignore vscode setting
abhira0 Oct 28, 2024
381ee65
delete all bug fix with new testcases added in favor of it
abhira0 Oct 29, 2024
4ac73d6
Merge pull request #42 from gitsetgopack/feature/api
UmangDiyora Oct 29, 2024
72c4232
allow github workflows to be able to push readme changes to the relea…
abhira0 Oct 29, 2024
ec35c71
Merge pull request #47 from gitsetgopack/feature/api
AsthaBhalodiya Oct 29, 2024
a511991
Update all badges in README
github-actions[bot] Oct 29, 2024
e6ad21d
Update all badges in README
github-actions[bot] Oct 29, 2024
89d27d9
Update all badges in README
github-actions[bot] Oct 29, 2024
5fc8da6
stop recursive workflow call
abhira0 Oct 29, 2024
624c276
Merge pull request #48 from gitsetgopack/feature/api
AsthaBhalodiya Oct 29, 2024
e68af84
Update all badges in README
github-actions[bot] Oct 29, 2024
87a2457
Update all badges in README
github-actions[bot] Oct 29, 2024
e09ee1d
Update all badges in README
github-actions[bot] Oct 29, 2024
7f61558
Update all badges in README
github-actions[bot] Oct 29, 2024
3f91e55
Update all badges in README
github-actions[bot] Oct 29, 2024
a671954
Update all badges in README
github-actions[bot] Oct 29, 2024
78f5023
Update all badges in README
github-actions[bot] Oct 29, 2024
cee7dd3
Update all badges in README
github-actions[bot] Oct 29, 2024
a281663
Update all badges in README
github-actions[bot] Oct 29, 2024
9bb35d1
Update all badges in README
github-actions[bot] Oct 29, 2024
3b07359
Update all badges in README
github-actions[bot] Oct 29, 2024
7fb6fc1
Update all badges in README
github-actions[bot] Oct 29, 2024
754180d
Update all badges in README
github-actions[bot] Oct 29, 2024
e72d6dd
Update all badges in README
github-actions[bot] Oct 29, 2024
cced212
Update all badges in README
github-actions[bot] Oct 29, 2024
e22f410
Update all badges in README
github-actions[bot] Oct 29, 2024
7cc570f
Update all badges in README
github-actions[bot] Oct 29, 2024
c084172
Update all badges in README
github-actions[bot] Oct 29, 2024
21de9ee
Update all badges in README
github-actions[bot] Oct 29, 2024
691db75
Update all badges in README
github-actions[bot] Oct 29, 2024
b4c32ee
Update all badges in README
github-actions[bot] Oct 29, 2024
9f17b85
Your commit message
UmangDiyora Oct 29, 2024
1d2072f
Fix trailing whitespaces
UmangDiyora Oct 29, 2024
dbf415e
Merge pull request #40 from gitsetgopack/tele-Bot
UmangDiyora Oct 31, 2024
9f0f46a
Update all badges in README
github-actions[bot] Oct 31, 2024
12abaf9
Update all badges in README
github-actions[bot] Oct 31, 2024
83e6fa0
Update all badges in README
github-actions[bot] Oct 31, 2024
b00e3cd
Update all badges in README
github-actions[bot] Oct 31, 2024
3c19f9e
Doc strings added
UmangDiyora Oct 31, 2024
e676fe5
ignore vscode setting
abhira0 Oct 28, 2024
84845bc
delete all bug fix with new testcases added in favor of it
abhira0 Oct 29, 2024
5da37bf
allow github workflows to be able to push readme changes to the relea…
abhira0 Oct 29, 2024
44c742f
Update all badges in README
github-actions[bot] Oct 29, 2024
daadebf
Update all badges in README
github-actions[bot] Oct 29, 2024
f6bf27f
Update all badges in README
github-actions[bot] Oct 29, 2024
873f410
stop recursive workflow call
abhira0 Oct 29, 2024
ca95bba
Update all badges in README
github-actions[bot] Oct 29, 2024
d831692
Update all badges in README
github-actions[bot] Oct 29, 2024
809fd28
Update all badges in README
github-actions[bot] Oct 29, 2024
88a68cd
Update all badges in README
github-actions[bot] Oct 29, 2024
ad09992
Update all badges in README
github-actions[bot] Oct 29, 2024
2ccad27
Update all badges in README
github-actions[bot] Oct 29, 2024
4ee3bf6
Update all badges in README
github-actions[bot] Oct 29, 2024
9f68424
Update all badges in README
github-actions[bot] Oct 29, 2024
c8c51e9
Update all badges in README
github-actions[bot] Oct 29, 2024
2a5dae5
Update all badges in README
github-actions[bot] Oct 29, 2024
a5712d5
Update all badges in README
github-actions[bot] Oct 29, 2024
488284a
Update all badges in README
github-actions[bot] Oct 29, 2024
4908264
Update all badges in README
github-actions[bot] Oct 29, 2024
0ac18f8
Update all badges in README
github-actions[bot] Oct 29, 2024
39fa893
Update all badges in README
github-actions[bot] Oct 29, 2024
0ca7ff3
Update all badges in README
github-actions[bot] Oct 29, 2024
36c3903
Update all badges in README
github-actions[bot] Oct 29, 2024
fc3792d
Update all badges in README
github-actions[bot] Oct 29, 2024
9033bae
Update all badges in README
github-actions[bot] Oct 29, 2024
66ab5a0
Update all badges in README
github-actions[bot] Oct 29, 2024
ba5bbad
Update all badges in README
github-actions[bot] Oct 29, 2024
7bf4433
Telegram start
UmangDiyora Oct 25, 2024
413dc2c
Telegram Starting
UmangDiyora Oct 25, 2024
8c918bf
Your commit message
UmangDiyora Oct 29, 2024
1ec0c83
Fix trailing whitespaces
UmangDiyora Oct 29, 2024
40f8ccb
Update all badges in README
github-actions[bot] Oct 31, 2024
05d390d
Update all badges in README
github-actions[bot] Oct 31, 2024
bb80c6f
Update all badges in README
github-actions[bot] Oct 31, 2024
815ea49
Update all badges in README
github-actions[bot] Oct 31, 2024
d042fcf
Update README.md
abhira0 Oct 23, 2024
e8b3d8d
Update all badges in README
github-actions[bot] Oct 23, 2024
23375ba
Update all badges in README
github-actions[bot] Oct 23, 2024
533f130
Update README.md
abhira0 Oct 23, 2024
4036ec5
Update README.md
abhira0 Oct 23, 2024
5a97c01
fix for check_pyenv in makefile
AsthaBhalodiya Oct 24, 2024
775f340
more changes to makefile
AsthaBhalodiya Oct 24, 2024
867d51a
Expenses and tests update
AsthaBhalodiya Oct 27, 2024
e4515c0
category test case update 1
AsthaBhalodiya Oct 31, 2024
b948292
analytics
AsthaBhalodiya Oct 31, 2024
2b6cd41
test cases updates
AsthaBhalodiya Oct 31, 2024
8b28850
Pylinted the code and added the test case file
UmangDiyora Oct 31, 2024
48df760
expenses
AsthaBhalodiya Oct 31, 2024
57c4e65
Login issue fixed
UmangDiyora Oct 31, 2024
5066ea7
Solved the error of username and password on different message in Log…
UmangDiyora Oct 31, 2024
116ca38
Solved the similar error with the signup of taking username and passw…
UmangDiyora Oct 31, 2024
9c20955
analytics.py
AsthaBhalodiya Oct 31, 2024
589513a
Merge branch 'release/2024.2' into ab-changes
AsthaBhalodiya Oct 31, 2024
a7d994b
Account id setup with signup
UmangDiyora Oct 31, 2024
9efe068
Getting account_id and token while logging in
UmangDiyora Oct 31, 2024
0977ff5
Cleaning up the code
UmangDiyora Oct 31, 2024
d199c34
Show category feature added
UmangDiyora Oct 31, 2024
5b9c7a6
account test update 1
AsthaBhalodiya Oct 31, 2024
b4ecb5c
account test update 2
AsthaBhalodiya Oct 31, 2024
c5b1995
account test update 3
AsthaBhalodiya Oct 31, 2024
d3063ec
account test update 4
AsthaBhalodiya Oct 31, 2024
bc9189d
Update all badges in README
github-actions[bot] Oct 29, 2024
5308f7f
Update all badges in README
github-actions[bot] Oct 29, 2024
4cdb47f
Update all badges in README
github-actions[bot] Oct 29, 2024
ff5f661
Update all badges in README
github-actions[bot] Oct 29, 2024
c671055
Update all badges in README
github-actions[bot] Oct 29, 2024
a411d55
Update all badges in README
github-actions[bot] Oct 29, 2024
ae40d31
Update all badges in README
github-actions[bot] Oct 29, 2024
077fd00
Update all badges in README
github-actions[bot] Oct 29, 2024
c3612b1
Update all badges in README
github-actions[bot] Oct 29, 2024
49485df
Update all badges in README
github-actions[bot] Oct 29, 2024
5b98d62
Update all badges in README
github-actions[bot] Oct 29, 2024
273decf
Update all badges in README
github-actions[bot] Oct 29, 2024
f83e10a
Update all badges in README
github-actions[bot] Oct 29, 2024
38261f1
Update all badges in README
github-actions[bot] Oct 29, 2024
decf69f
Update all badges in README
github-actions[bot] Oct 29, 2024
390f0b0
Update all badges in README
github-actions[bot] Oct 29, 2024
1ea29d3
Update all badges in README
github-actions[bot] Oct 29, 2024
8a1961e
Update all badges in README
github-actions[bot] Oct 29, 2024
44fef7b
Update all badges in README
github-actions[bot] Oct 29, 2024
1d43e3b
Update all badges in README
github-actions[bot] Oct 29, 2024
c0cfc03
Update all badges in README
github-actions[bot] Oct 29, 2024
b4b45ec
Update all badges in README
github-actions[bot] Oct 29, 2024
9d6bf98
Update all badges in README
github-actions[bot] Oct 29, 2024
45f9b86
Update all badges in README
github-actions[bot] Oct 29, 2024
2075471
Telegram start
UmangDiyora Oct 25, 2024
6ef294f
Telegram Starting
UmangDiyora Oct 25, 2024
57a23a0
Your commit message
UmangDiyora Oct 29, 2024
3169b0b
Fix trailing whitespaces
UmangDiyora Oct 29, 2024
a589dbb
Update all badges in README
github-actions[bot] Oct 31, 2024
ea6f3ee
Update all badges in README
github-actions[bot] Oct 31, 2024
4c8b662
Update all badges in README
github-actions[bot] Oct 31, 2024
efc8fff
Update all badges in README
github-actions[bot] Oct 31, 2024
93930e5
test analytics and other pr issues resolve
AsthaBhalodiya Oct 31, 2024
f7db170
requirements update
AsthaBhalodiya Oct 31, 2024
af3cf8b
update number of tests link
abhira0 Oct 31, 2024
cfc7ceb
Update all badges in README
github-actions[bot] Oct 31, 2024
98ba96e
Update all badges in README
github-actions[bot] Oct 31, 2024
df2a4b0
Update all badges in README
github-actions[bot] Oct 31, 2024
1a5035e
Update all badges in README
github-actions[bot] Oct 31, 2024
31b9164
Update all badges in README
github-actions[bot] Oct 31, 2024
666ce33
Update all badges in README
github-actions[bot] Oct 31, 2024
c903e92
Update all badges in README
github-actions[bot] Oct 31, 2024
d878543
Update all badges in README
github-actions[bot] Oct 31, 2024
38b853f
non recursive workflow
abhira0 Oct 31, 2024
f500a47
analytics tets updayte
AsthaBhalodiya Oct 31, 2024
da22e6c
Merge branch 'release/2024.2' into feature/api
abhira0 Oct 31, 2024
49482b5
rename folders
abhira0 Oct 31, 2024
b27dea4
put tests dir in root
abhira0 Oct 31, 2024
8771c58
Merge branch 'release/2024.2' into ab-changes
AsthaBhalodiya Oct 31, 2024
50aa730
reorg
abhira0 Oct 31, 2024
0ebce7f
delete unnecessary files
AsthaBhalodiya Oct 31, 2024
f3a6854
reorg 2
abhira0 Oct 31, 2024
073341c
disaable workflow
abhira0 Oct 31, 2024
de5ffba
Merge pull request #51 from gitsetgopack/feature/api
abhira0 Oct 31, 2024
2963c5f
Temp commit
UmangDiyora Oct 31, 2024
65f239e
Temp commit
UmangDiyora Oct 31, 2024
3569f9c
Merge remote-tracking branch 'origin/release/2024.2' into tele-Bot
UmangDiyora Oct 31, 2024
e748041
reorg
UmangDiyora Oct 31, 2024
fad9288
reorg 2
UmangDiyora Oct 31, 2024
5563d22
test changes
UmangDiyora Oct 31, 2024
9195195
Merge pull request #52 from gitsetgopack/tele-Bot
UmangDiyora Oct 31, 2024
b2eeecd
add yamllint
abhira0 Oct 31, 2024
5f22d48
merge
abhira0 Oct 31, 2024
462dc03
Merge remote-tracking branch 'origin/release/2024.2' into feature/api
abhira0 Oct 31, 2024
e927fe8
pytest -v
abhira0 Oct 31, 2024
8419a5d
pytest -v
abhira0 Oct 31, 2024
efcb317
Merge branch 'release/2024.2' into feature/api
abhira0 Oct 31, 2024
2d25c09
fix for issue 54
abhira0 Oct 31, 2024
4f47649
fix for issue 45
abhira0 Oct 31, 2024
080acab
Expense button added
UmangDiyora Nov 1, 2024
f20b885
Added form like structure in add expenses option
UmangDiyora Nov 1, 2024
7ccbdf4
temp changes
AsthaBhalodiya Nov 1, 2024
62bd026
Merge remote-tracking branch 'origin/release/2024.2' into ab-changes
AsthaBhalodiya Nov 1, 2024
c259c80
temp save
AsthaBhalodiya Nov 1, 2024
89937d8
adding mypy badge
abhira0 Nov 1, 2024
374547b
update badge after pre-commit
abhira0 Nov 1, 2024
fdefec8
remove bot for pre-commit to pass
abhira0 Nov 1, 2024
901894a
addding bandit
abhira0 Nov 1, 2024
9525405
trigger update badge
abhira0 Nov 1, 2024
b05820d
all branch
abhira0 Nov 1, 2024
e58a204
remove branches
abhira0 Nov 1, 2024
c51339a
adding mypy and bandit badge
abhira0 Nov 1, 2024
225e5de
adding more pre-commit checks
abhira0 Nov 1, 2024
7982ddb
"Resolved problem of messagehandling
UmangDiyora Nov 1, 2024
14b5cc7
working precommit
abhira0 Nov 1, 2024
ab36706
run update-badge only on pr on release
abhira0 Nov 1, 2024
d770c10
have one workflow file
abhira0 Nov 1, 2024
7b7eb59
typo
abhira0 Nov 1, 2024
3a40a2c
Added buttons for Categories section
UmangDiyora Nov 1, 2024
0c374a1
base_ref
abhira0 Nov 1, 2024
c3a43c8
fetch-depth: 0
abhira0 Nov 1, 2024
d2f0797
checkout ref_name
abhira0 Nov 1, 2024
ec4eb51
Disable pre-commit job in GitHub Actions workflow
abhira0 Nov 1, 2024
753d898
github.head_ref
abhira0 Nov 1, 2024
c603cbb
Merge 753d8983455890e3a9ec3b482efcd5e3813c5ccb into c51339a5f872828b9…
abhira0 Nov 1, 2024
dde8347
Update all badges in README
github-actions[bot] Nov 1, 2024
2338266
testing direct eradme push
abhira0 Nov 1, 2024
5c61e17
stash before changes
abhira0 Nov 1, 2024
88c11c8
Update all badges in README
github-actions[bot] Nov 1, 2024
a35da39
use head_ref and not base_ref
abhira0 Nov 1, 2024
1e515cc
Merge branch 'release/2024.2' into feature/api
abhira0 Nov 1, 2024
aaffbed
Update all badges in README
github-actions[bot] Nov 1, 2024
b8aa175
Merge pull request #56 from gitsetgopack/feature/api
abhira0 Nov 1, 2024
8326332
Refactor GitHub Actions workflow to enable pre-commit checks
abhira0 Nov 1, 2024
2d090ad
Update all badges in README
github-actions[bot] Nov 1, 2024
e0f83cf
Merge pull request #64 from gitsetgopack/feature/api
abhira0 Nov 1, 2024
8d49298
"add categories dones"
UmangDiyora Nov 1, 2024
262ff83
pytest -v
abhira0 Oct 31, 2024
c30c2c4
Revert "pytest -v"
abhira0 Oct 31, 2024
6da6b7d
Merge remote-tracking branch 'origin/release/2024.2' into tele-Bot
abhira0 Nov 1, 2024
42de776
add categories with user auth
UmangDiyora Nov 1, 2024
cf5f08f
"Edit categories function added"
UmangDiyora Nov 1, 2024
c646cf6
more tmp
AsthaBhalodiya Nov 1, 2024
e9d5f3d
Merge remote-tracking branch 'origin/release/2024.2' into ab-changes
AsthaBhalodiya Nov 1, 2024
1c36c2c
"Delete category function is been added"
UmangDiyora Nov 1, 2024
c67c67a
Auth Decorator added
UmangDiyora Nov 1, 2024
e13baf3
Changed Start command
UmangDiyora Nov 1, 2024
9c52027
Change in sign up
UmangDiyora Nov 1, 2024
e195356
change in attempt login
UmangDiyora Nov 1, 2024
82ac315
analytics final update
AsthaBhalodiya Nov 1, 2024
06b1337
code_of_conduct
AsthaBhalodiya Nov 1, 2024
ece3d59
toc update
AsthaBhalodiya Nov 1, 2024
8a0a44e
Update all badges in README
github-actions[bot] Nov 1, 2024
1e4ebad
"Changed the whole codes auth"
UmangDiyora Nov 1, 2024
a8c3692
Refactor analytics tests to improve coverage and handle edge cases fo…
abhira0 Nov 2, 2024
5a945e9
"Some Changes"
UmangDiyora Nov 2, 2024
bbc44bf
random changes
UmangDiyora Nov 2, 2024
23bb270
Add validation for monthly budget and enhance category tests
abhira0 Nov 2, 2024
f2e6553
Update all badges in README
github-actions[bot] Nov 2, 2024
ea442ac
"edit category worked"
UmangDiyora Nov 2, 2024
abc18a7
Merge pull request #50 from gitsetgopack/ab-changes
abhira0 Nov 2, 2024
c05b14d
Fix merge conflict in README and clean up badge section
abhira0 Nov 2, 2024
debf725
Clean up README by removing duplicate badges and unnecessary entries
abhira0 Nov 2, 2024
94b5ea8
Update all badges in README
github-actions[bot] Nov 2, 2024
8bdf1dd
Merge pull request #67 from gitsetgopack/ab-changes
abhira0 Nov 2, 2024
0a450cd
"Added handling expenses feature"
UmangDiyora Nov 2, 2024
2b0e313
adding install.md
UmangDiyora Nov 2, 2024
82c2693
adding contributing md
UmangDiyora Nov 2, 2024
5d3d6a0
added DOI
UmangDiyora Nov 2, 2024
9573842
pre-commit changes
UmangDiyora Nov 2, 2024
664103c
Merge remote-tracking branch 'origin/release/2024.2' into tele-Bot
UmangDiyora Nov 2, 2024
c3c326f
md toc
UmangDiyora Nov 2, 2024
dea2937
skip pylint on bots
UmangDiyora Nov 2, 2024
de87bbf
adding some pos test cases for telegram bot
UmangDiyora Nov 2, 2024
6d39658
formating
UmangDiyora Nov 2, 2024
8568b5a
remove pytest_asyncio
UmangDiyora Nov 2, 2024
dd90310
added req
UmangDiyora Nov 2, 2024
e3745f2
new line
UmangDiyora Nov 2, 2024
c82d8a7
Update all badges in README
github-actions[bot] Nov 2, 2024
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
8 changes: 0 additions & 8 deletions .codecov.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/issue-task-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Pull Request Template](#pull-request-template)
- [Description](#description)
- [Type of change](#type-of-change)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Pull Request Template

## Description
Expand Down
193 changes: 193 additions & 0 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
name: github-ci

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- "release/*"

permissions:
contents: write

jobs:

pre-commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Set PYTHONPATH
run: |
echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV

- name: Run pre-commit
run: |
pre-commit run --all-files

update-badges:
needs: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Setup
run: |
mkdir tmp
sudo apt-get install -y libxml2-utils
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Format check with black
run: |
echo "BLACK_EXIT_CODE=0" >> $GITHUB_ENV
black . --check || echo "BLACK_EXIT_CODE=1" >> $GITHUB_ENV

- name: Run pylint
continue-on-error: true
run: |
echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
echo "PYLINT_EXIT_CODE=0" >> $GITHUB_ENV
pylint api > tmp/pylint_output.txt || echo "PYLINT_EXIT_CODE=$?" >> $GITHUB_ENV
cat tmp/pylint_output.txt

- name: Run pytest
continue-on-error: true
run: |
echo "PYTEST_EXIT_CODE=0" >> $GITHUB_ENV
pytest --cov-report=json:tmp/coverage.json --junitxml=tmp/pytest_output.xml || echo "PYTEST_EXIT_CODE=$?" >> $GITHUB_ENV

- name: Run MyPy
continue-on-error: true
run: |
echo "MYPY_EXIT_CODE=0" >> $GITHUB_ENV
mypy api || echo "MYPY_EXIT_CODE=1" >> $GITHUB_ENV

- name: Run Bandit
continue-on-error: true
run: |
echo "BANDIT_EXIT_CODE=0" >> $GITHUB_ENV
bandit -r api || echo "BANDIT_EXIT_CODE=1" >> $GITHUB_ENV

- name: Generate black badge URL
run: |
BLACK_EXIT_CODE=${{ env.BLACK_EXIT_CODE }}
if [ "$BLACK_EXIT_CODE" -eq 0 ]; then
BLACK_BADGE_URL="https://img.shields.io/badge/black_formatter-passing-brightgreen?style=plastic&labelColor=black"
else
BLACK_BADGE_URL="https://img.shields.io/badge/black_formatter-failing-red?style=plastic&labelColor=black"
fi
echo "BLACK_BADGE_URL=$BLACK_BADGE_URL" >> $GITHUB_ENV

- name: Generate pylint badge URL
run: |
SCORE=$(grep -oP '(?<=rated at )[0-9]+\.[0-9]+' tmp/pylint_output.txt)
if [ "$(echo "$SCORE < 5" | bc)" -eq 1 ]; then
COLOR="red"
elif [ "$(echo "$SCORE < 8" | bc)" -eq 1 ]; then
COLOR="orange"
elif [ "$(echo "$SCORE < 10" | bc)" -eq 1 ]; then
COLOR="yellow"
else
COLOR="brightgreen"
fi
PYLINT_BADGE_URL="https://img.shields.io/badge/pylint-${SCORE}-${COLOR}?style=plastic"
echo "PYLINT_BADGE_URL=$PYLINT_BADGE_URL" >> $GITHUB_ENV

- name: Generate MyPy badge URL
run: |
MYPY_EXIT_CODE=${{ env.MYPY_EXIT_CODE }}
if [ "$MYPY_EXIT_CODE" -eq 0 ]; then
MYPY_BADGE_URL="https://img.shields.io/badge/mypy-passing-brightgreen?style=plastic"
else
MYPY_BADGE_URL="https://img.shields.io/badge/mypy-failing-red?style=plastic"
fi
echo "MYPY_BADGE_URL=$MYPY_BADGE_URL" >> $GITHUB_ENV

- name: Generate Bandit badge URL
run: |
BANDIT_EXIT_CODE=${{ env.BANDIT_EXIT_CODE }}
if [ "$BANDIT_EXIT_CODE" -eq 0 ]; then
BANDIT_BADGE_URL="https://img.shields.io/badge/bandit-passing-brightgreen?style=plastic"
else
BANDIT_BADGE_URL="https://img.shields.io/badge/bandit-failing-red?style=plastic"
fi
echo "BANDIT_BADGE_URL=$BANDIT_BADGE_URL" >> $GITHUB_ENV

- name: Extract number of tests, coverage, and determine result
run: |
NUM_TESTS=$(xmllint --xpath 'string(//testsuite/@tests)' tmp/pytest_output.xml)
COVERAGE=$(jq '.totals.percent_covered' tmp/coverage.json | awk '{printf "%.0f", $1}')
if [ ${{ env.PYTEST_EXIT_CODE }} -eq 0 ]; then
TESTS_STATUS="passing"
TESTS_COLOR="brightgreen"
else
TESTS_STATUS="failing"
TESTS_COLOR="red"
fi
if [ "$COVERAGE" -ge 90 ]; then
COVERAGE_COLOR="brightgreen"
elif [ "$COVERAGE" -ge 80 ]; then
COVERAGE_COLOR="green"
elif [ "$COVERAGE" -ge 70 ]; then
COVERAGE_COLOR="yellowgreen"
elif [ "$COVERAGE" -ge 60 ]; then
COVERAGE_COLOR="yellow"
elif [ "$COVERAGE" -ge 50 ]; then # corrected line
COVERAGE_COLOR="orange"
else
COVERAGE_COLOR="red"
fi

TOTAL_TESTS_BADGE_URL="https://img.shields.io/badge/tests-${NUM_TESTS}-blue?style=plastic&logo=pytest&logoColor=white"
CODE_COVERAGE_BADGE_URL="https://img.shields.io/badge/coverage-${COVERAGE}%25-${COVERAGE_COLOR}?style=plastic"
PYTEST_STATUS_BADGE_URL="https://img.shields.io/badge/PyTest-${TESTS_STATUS}-${TESTS_COLOR}?style=plastic&logo=pytest&logoColor=white"
echo "TOTAL_TESTS_BADGE_URL=$TOTAL_TESTS_BADGE_URL" >> $GITHUB_ENV
echo "CODE_COVERAGE_BADGE_URL=$CODE_COVERAGE_BADGE_URL" >> $GITHUB_ENV
echo "PYTEST_STATUS_BADGE_URL=$PYTEST_STATUS_BADGE_URL" >> $GITHUB_ENV


- name: Update README with all the badges
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git stash
git checkout ${{ github.head_ref }}

RUN_LOG_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sed -i '/\[!\[badge_black\]/c\[!\[badge_black\]('"$BLACK_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
sed -i '/\[!\[badge_pylint\]/c\[!\[badge_pylint\]('"$PYLINT_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
sed -i '/\[!\[badge_mypy\]/c\[!\[badge_mypy\]('"$MYPY_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
sed -i '/\[!\[badge_bandit\]/c\[!\[badge_bandit\]('"$BANDIT_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
sed -i '/\[!\[badge_total_tests\]/c\[!\[badge_total_tests\]('"$TOTAL_TESTS_BADGE_URL"')](https://github.com/gitsetgopack/hw2/tree/main/tests)' README.md
sed -i '/\[!\[badge_code_coverage\]/c\[!\[badge_code_coverage\]('"$CODE_COVERAGE_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
sed -i '/\[!\[badge_pytest_status\]/c\[!\[badge_pytest_status\]('"$PYTEST_STATUS_BADGE_URL"')]('"$RUN_LOG_URL"')' README.md
git add README.md
git commit -m "Update all badges in README"
git push origin

- name: Fail if any tool failed
run: |
for TOOL in BLACK PYLINT PYTEST MYPY BANDIT; do
EXIT_CODE_VAR="${TOOL}_EXIT_CODE"
EXIT_CODE="${!EXIT_CODE_VAR}"
if [ "$EXIT_CODE" -ne 0 ]; then
exit 1
fi
done
34 changes: 0 additions & 34 deletions .github/workflows/styleChecker.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/testCases.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
api/routers/config.py
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
Loading