{"id":20703842,"url":"https://github.com/euiyounghwang/python-cicd-fastapi-basic","last_synced_at":"2026-04-09T15:49:39.954Z","repository":{"id":221045411,"uuid":"753294989","full_name":"euiyounghwang/python-CICD-fastapi-basic","owner":"euiyounghwang","description":"python-fastapi-basic-CICD","archived":false,"fork":false,"pushed_at":"2024-11-30T20:43:34.000Z","size":220,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T19:55:25.010Z","etag":null,"topics":["circlci","circle-ci","docker","docker-compose","elasticsearch","fastapi","github-actions","jenkins","kibana","kibana-plugin","poetry","pydantic","pytest","python3","restapi-framework","shell-script","starlette","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/euiyounghwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-05T20:54:54.000Z","updated_at":"2024-11-30T20:43:27.000Z","dependencies_parsed_at":"2024-02-05T22:31:08.052Z","dependency_job_id":"054c8d2a-2ef1-441d-a531-263e1e16461f","html_url":"https://github.com/euiyounghwang/python-CICD-fastapi-basic","commit_stats":null,"previous_names":["euiyounghwang/python-cicd-fastapi-basic"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euiyounghwang%2Fpython-CICD-fastapi-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euiyounghwang%2Fpython-CICD-fastapi-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euiyounghwang%2Fpython-CICD-fastapi-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euiyounghwang%2Fpython-CICD-fastapi-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/euiyounghwang","download_url":"https://codeload.github.com/euiyounghwang/python-CICD-fastapi-basic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242970773,"owners_count":20214869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circlci","circle-ci","docker","docker-compose","elasticsearch","fastapi","github-actions","jenkins","kibana","kibana-plugin","poetry","pydantic","pytest","python3","restapi-framework","shell-script","starlette","swagger","swagger-ui"],"created_at":"2024-11-17T01:09:46.816Z","updated_at":"2025-12-30T19:34:30.764Z","avatar_url":"https://github.com/euiyounghwang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-CICD-fastapi-basic\n\u003ci\u003epython-fastapi-basic-CICD\n\n- Reference : \u003ci\u003ehttps://github.com/san99tiago/fastapi-docker-github-actions/tree/main/.github/workflows\u003c/i\u003e\n![Alt text](./screenshots/GHA.png)\n\nFastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.\n\nThe key features are:\n\n- Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic). One of the fastest Python frameworks available.\n- Fast to code: Increase the speed to develop features by about 200% to 300%. *\n- Fewer bugs: Reduce about 40% of human (developer) induced errors. *\n- Intuitive: Great editor support. Completion everywhere. Less time debugging.\n- Easy: Designed to be easy to use and learn. Less time reading docs.\n- Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.\n- Robust: Get production-ready code. With automatic interactive documentation.\n- Standards-based: Based on (and fully compatible with) the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.\n\n\n### Install Poerty\n```\nhttps://python-poetry.org/docs/?ref=dylancastillo.co#installing-with-the-official-installer\n```\n\n\n### Using Python Virtual Environment\n```bash\npython -m venv .venv\nsource .venv/bin/activate\n```\n\n\n### Using Poetry: Create the virtual environment in the same directory as the project and install the dependencies:\n```bash\npoetry config virtualenvs.in-project true\npoetry init\npoetry add fastapi\npoetry add uvicorn\npoetry add pytz\npoetry add httpx\npoetry add pytest\npoetry add pytest-cov\npoetry add requests\npoetry add pyyaml\npoetry add elasticsearch==7.13\npoetry add python-dotenv\n```\n\n\n### Pytest\n- Go to virtual enviroment using `source .venv/bin/activate`\n- Run this command manually: `poetry run py.test -v --junitxml=test-reports/junit/pytest.xml --cov-report html --cov tests/` or `./pytest.sh`\n```bash\n➜  python-CICD-fastapi-basic git:(master) ✗ ./pytest.sh\n================================================ test session starts ================================================\nplatform darwin -- Python 3.9.7, pytest-7.0.1, pluggy-0.13.1 -- /Users/euiyoung.hwang/opt/anaconda3/bin/python\ncachedir: .pytest_cache\nrootdir: /Users/euiyoung.hwang/ES/Python_Workspace/python-CICD-fastapi-basic/tests, configfile: pytest.ini\nplugins: anyio-3.6.1, mock-3.6.1, cov-4.0.0\ncollected 1 item                                                                                                    \n\ntests/test_api.py::test_api PASSED                                                                            [100%]\n\n================================================= 1 passed in 0.05s =================================================\n➜  python-CICD-fastapi-basic git:(master) ✗ source .venv/bin/activate\n(.venv) ➜  python-CICD-fastapi-basic git:(master) ✗ ./pytest.sh              \n================================================ test session starts ================================================\nplatform darwin -- Python 3.9.7, pytest-7.0.1, pluggy-0.13.1 -- /Users/euiyoung.hwang/opt/anaconda3/bin/python\ncachedir: .pytest_cache\nrootdir: /Users/euiyoung.hwang/ES/Python_Workspace/python-CICD-fastapi-basic/tests, configfile: pytest.ini\nplugins: anyio-3.6.1, mock-3.6.1, cov-4.0.0\ncollected 1 item                                                                                                    \n\ntests/test_api.py::test_api PASSED                                                                            [100%]\n\n================================================= 1 passed in 0.12s =================================================\n(.venv) ➜  python-CICD-fastapi-basic git:(master) ✗ \n```\n\n\n### CI/CD Environment\n- CircleCI (`./circleci/config.yml`): CircleCI is a continuous integration and continuous delivery platform that helps software teams work smarter, faster. With CircleCI, every commit kicks off a new job in our platform, and code is built, tested, and deployed. \n- Github Actions (`./.github/workflows/build-and-test.yml`) : GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.\n\n\n### Slack for alert through Github Actions\n- Slack for app (\u003ci\u003ehttps://velog.io/@devand/%EC%8A%AC%EB%9E%99-Web-API-%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%B4%EB%B3%B4%EC%9E%90-1\u003c/i\u003e)\n- create app to slack (https://api.slack.com/apps)\n- Permission for new app user : Features \u003e OAuth \u0026 Permissions (incoming-webhook, chat:write, groups:write for secrets)\n```bash\ncurl -X POST -H 'Content-type: application/json' --data '{\"text\":\"Hello, World!\"}' \u003cslack incomming URL\u003e\n```\n- Slack alerts from master branch\n```bash\n# Failure\neuiyounghwangeuiyounghwang\nWorkflow Build and Test job build-tests triggered by push is FAILURE for master\n1d035a00 - 1 commits\nJob Steps\n:heavy_check_mark: fe3a7aab5c294ff1bb4920e7f3615586\n:heavy_check_mark: Build-Poetry\n:heavy_check_mark: Test-Postgres\n:heavy_check_mark: Test-Redis\n:heavy_check_mark: Install-Elasticsearch\n:x: Run-Elasticsearch\n:no_entry_sign: Test-Elasticsearch\n:no_entry_sign: Build-tests\n\u003chttps://github.com/euiyounghwang/python-CICD-fastapi-basic|euiyounghwang/python-CICD-fastapi-basic\u003e \n#163euiyounghwang/python-CICD-fastapi-basic #163 | Today at 11:28 PM\n\n# Success\neuiyounghwangeuiyounghwang\nWorkflow Build and Test job alert triggered by push is SUCCESS for master\n93e61e9c - 1 commits\n\u003chttps://github.com/euiyounghwang/python-CICD-fastapi-basic|euiyounghwang/python-CICD-fastapi-basic\u003e #164euiyounghwang/python-CICD-fastapi-basic #164 | Today at 11:32 PM\n```\n\n### Git Branch\n- git branch -D SEARCH-476\n- git push origin --delete SEARCH-476","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuiyounghwang%2Fpython-cicd-fastapi-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuiyounghwang%2Fpython-cicd-fastapi-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuiyounghwang%2Fpython-cicd-fastapi-basic/lists"}