{"id":480292,"date":"2026-05-19T14:32:11","date_gmt":"2026-05-19T14:32:11","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480292"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480292","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c CI\/CD \u0432 GitHub \u0434\u043b\u044f Python-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>1. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>CI\/CD \u2014 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0442\u0435\u043e\u0440\u0438\u0438, \u0442\u043e:<\/p>\n<ul>\n<li>\n<p><strong>CI (Continuous Integration \/ \u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f)<\/strong> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u043d \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0441 \u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438. \u0426\u0435\u043b\u044c \u2014 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b.<\/p>\n<\/li>\n<li>\n<p><strong>CD (Continuous Deployment \/ \u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435)<\/strong> \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0434\u0435\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 CI \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u041a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u2014 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0432 Docker Hub \u0438\u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0432 PyPI.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u0430\u0447\u0435\u043c CI\/CD \u043d\u0443\u0436\u0435\u043d \u0432 Python-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445<\/h4>\n<p>Python \u2014 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0439\u043c\u0430\u043b \u0431\u044b \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0441\u044a\u0435\u0445\u0430\u0432\u0448\u0438\u0439 \u043e\u0442\u0441\u0442\u0443\u043f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/p>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 CI\/CD \u0432 Python-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u0440\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ol>\n<li>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0443\u0442\u0438\u043d\u044b.<\/strong> \u0412\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c <code>pytest<\/code>, <code>black<\/code>, <code>isort<\/code> \u0438\u043b\u0438 <code>flake8<\/code>. \u0412\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0435 <code>push<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p><strong>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 \u043a\u043e\u0434\u0430 (PEP8).<\/strong> \u0412 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 (main\/master) \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0441\u0442\u0438\u043b\u044c \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e. \u042d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0447\u0430\u0441\u044b \u043d\u0430 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e \u2014 \u043b\u044e\u0434\u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u044e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0430 \u043d\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p><strong>\u0423\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u00ab\u0410 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00bb.<\/strong> \u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c, \u0447\u0438\u0441\u0442\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0432 <code>requirements.txt<\/code> \u0438\u043b\u0438 <code>pyproject.toml<\/code>, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0441\u0440\u0430\u0437\u0443 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 <code>ModuleNotFoundError<\/code>, \u0438 \u0432\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u044d\u0442\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043a\u043e\u0434 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 GitHub Actions<\/h4>\n<p>\u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043c\u043d\u043e\u0433\u043e CI\/CD \u0441\u0438\u0441\u0442\u0435\u043c: GitLab CI, Jenkins, CircleCI. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u0436\u0438\u0432\u0435\u0442 \u043d\u0430 GitHub, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GitHub Actions \u2014 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.<\/p>\n<ul>\n<li>\n<p><strong>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb.<\/strong> \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0430\u0440\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u043d\u043d\u0435\u0440\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u0431\u0445\u0443\u043a\u0438 (\u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Jenkins). \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c YAML-\u0444\u0430\u0439\u043b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>.github\/workflows\/<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u043c\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u0429\u0435\u0434\u0440\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b.<\/strong> GitHub \u0434\u0430\u0435\u0442 2000 \u043c\u0438\u043d\u0443\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432. \u0414\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 open-source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e. \u0414\u043b\u044f \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438.<\/strong> \u0412 GitHub Marketplace \u0435\u0441\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u044d\u043a\u0448\u0435\u043d\u043e\u0432 (\u0448\u0430\u0433\u043e\u0432). \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c bash-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Python, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u0434\u0435\u043f\u043b\u043e\u044f \u043f\u043e SSH \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 2-3 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>2. \u041d\u0430\u0448 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c CI\/CD \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439, \u0445\u043e\u0442\u044c \u0438 \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 <strong>FastAPI<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043c\u0430\u0441\u0441\u044b \u0442\u0435\u043b\u0430 (BMI). \u041e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0435\u0441 \u0438 \u0440\u043e\u0441\u0442, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441.<\/p>\n<h4>\u0427\u0442\u043e \u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c<\/h4>\n<p>\u0412\u043e\u0442 \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0442\u0440\u043e\u043a \u0438 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>src\/main.py<\/code>:<\/p>\n<pre><code class=\"python\">from fastapi import FastAPI, HTTPExceptionapp = FastAPI()@app.get(\"\/bmi\")def calculate_bmi(weight: float, height: float):    if height &lt;= 0 or weight &lt;= 0:        raise HTTPException(status_code=400, detail=\"\u0420\u043e\u0441\u0442 \u0438 \u0432\u0435\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f\")        bmi = weight \/ (height ** 2)    return {\"weight\": weight, \"height\": height, \"bmi\": round(bmi, 2)}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0430\u0434\u0430\u0435\u0442, \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>tests\/test_main.py<\/code>:<\/p>\n<pre><code class=\"python\">from fastapi.testclient import TestClientfrom src.main import appclient = TestClient(app)def test_calculate_bmi_success():    # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0432\u0435\u0441\u043e\u043c 70 \u043a\u0433 \u0438 \u0440\u043e\u0441\u0442\u043e\u043c 1.75 \u043c    response = client.get(\"\/bmi?weight=70&amp;height=1.75\")    assert response.status_code == 200    assert response.json()[\"bmi\"] == 22.86<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/h4>\n<p>\u041d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0424\u0430\u0439\u043b\u044b \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u043f\u0430\u043f\u043a\u0430\u043c, \u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>bmi_project\/\u251c\u2500\u2500 requirements.txt       # \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b fastapi, uvicorn, pytest, httpx \u0438 ruff\u251c\u2500\u2500 src\/\u2502   \u251c\u2500\u2500 __init__.py\u2502   \u2514\u2500\u2500 main.py            # \u041d\u0430\u0448 API\u2514\u2500\u2500 tests\/    \u251c\u2500\u2500 __init__.py    \u2514\u2500\u2500 test_main.py       # \u041d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0420\u0443\u0447\u043d\u0430\u044f \u0440\u0443\u0442\u0438\u043d\u0430 (\u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f)<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0444\u0438\u0447\u0443 \u0432 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u0432 GitHub (\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>git push<\/code>), \u0432\u044b \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<ol>\n<li>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/strong> (\u0432\u0434\u0440\u0443\u0433 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">pip install -r requirements.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<ol start=\"2\">\n<li>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043b\u0438\u043d\u0442\u0435\u0440<\/strong> (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>ruff<\/code>), \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 PEP8:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">    ruff check .<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<ol start=\"3\">\n<li>\n<p><strong>\u041f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u0430\u0441\u044c:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">    pytest<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u0442\u0430\u043a \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0431\u0443\u0434\u0435\u0442\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c? \u0418\u043b\u0438 \u043f\u043e\u043b\u0435\u043d\u0438\u0442\u0435\u0441\u044c? \u041f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434 \u0443\u043b\u0435\u0442\u0438\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435.<\/p>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 GitHub \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435. \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u043e\u0431\u043e\u0442.<\/p>\n<p>\u041e\u0439, \u0432\u0438\u0436\u0443 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 Markdown \u0441\u043b\u043e\u043c\u0430\u043b\u0430\u0441\u044c \u2014 \u044f \u0437\u0430\u0431\u044b\u043b \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 &#171;&#171;`, \u0438 \u0432\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0443\u043b\u0435\u0442\u0435\u043b \u0432\u043d\u0443\u0442\u0440\u044c. \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438! \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0441\u044c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.<\/p>\n<h2>3. \u041f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d (\u0411\u0430\u0437\u043e\u0432\u044b\u0439 CI)<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b GitHub \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u044b \u043e\u0442 \u043d\u0435\u0433\u043e \u0445\u043e\u0442\u0438\u043c, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. GitHub Actions \u0438\u0449\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435: \u0432 \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 <code>.github\/workflows\/<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043c \u0444\u0430\u0439\u043b \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <code>ci.yml<\/code> (\u0438\u043c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.yml<\/code>).<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043a\u0435\u043b\u0435\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430:<\/p>\n<pre><code class=\"yaml\">name: API CI\/CD# 1. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c (Triggers)on:  push:    branches: [ \"main\" ]  pull_request:    branches: [ \"main\" ]# 2. \u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c (Jobs)jobs:  build-and-test:    runs-on: ubuntu-latest # \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Linux    # 3. \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f (Steps)    steps:      - name: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f        uses: actions\/checkout@v4      - name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Python 3.11        uses: actions\/setup-python@v5        with:          python-version: \"3.11\"      - name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438        run: |          python -m pip install --upgrade pip          pip install -r requirements.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u0434 \u043f\u043e \u043a\u043e\u0441\u0442\u043e\u0447\u043a\u0430\u043c<\/h4>\n<ul>\n<li>\n<p><code><strong>name<\/strong><\/code>: \u0418\u043c\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 GitHub \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u00abActions\u00bb.<\/p>\n<\/li>\n<li>\n<p><code><strong>on<\/strong><\/code>: \u042d\u0442\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440. \u041c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c: \u00abGitHub, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u043f\u0443\u0448\u0438\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0432\u0435\u0442\u043a\u0443 <code>main<\/code> \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432 \u043d\u0435\u0435 Pull Request\u00bb.<\/p>\n<\/li>\n<li>\n<p><code><strong>jobs<\/strong><\/code>: \u0417\u0430\u0434\u0430\u0447\u0438. \u041f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043c\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u0435\u0451 <code>build-and-test<\/code>.<\/p>\n<\/li>\n<li>\n<p><code><strong>runs-on: ubuntu-latest<\/strong><\/code>: GitHub \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0447\u0438\u0441\u0442\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Ubuntu.<\/p>\n<\/li>\n<li>\n<p><code><strong>steps<\/strong><\/code>: \u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u042d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0448\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c:<\/p>\n<\/li>\n<\/ul>\n<ol>\n<li>\n<p><code><strong>actions\/checkout@v4<\/strong><\/code> \u2014 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u044d\u043a\u0448\u0435\u043d (action). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0443\u0441\u0442\u043e\u0439. \u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443.<\/p>\n<\/li>\n<li>\n<p><code><strong>actions\/setup-python@v5<\/strong><\/code> \u2014 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u044d\u043a\u0448\u0435\u043d. \u041e\u043d \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Python (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 3.11).<\/p>\n<\/li>\n<li>\n<p><code><strong>run<\/strong><\/code> \u2014 \u0430 \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0420\u043e\u0432\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e: \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>pip<\/code> \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>fastapi<\/code>, <code>pytest<\/code> \u0438 <code>ruff<\/code> \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<h2>4. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: \u0422\u0435\u0441\u0442\u044b \u0438 \u041b\u0438\u043d\u0442\u0435\u0440\u044b<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u043e\u0442\u043e\u0432, \u043d\u0430 \u043d\u0435\u043c \u043b\u0435\u0436\u0438\u0442 \u043d\u0430\u0448 \u043a\u043e\u0434 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>ci.yml<\/code>. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0431\u043b\u043e\u043a\u0430 <code>steps<\/code> \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u0432\u043e\u0434\u0438\u043b\u0438 \u0440\u0443\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"yaml\">      - name: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c (Ruff)        run: ruff check .      - name: \u0417\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 (Pytest)        run: pytest<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0441\u0451, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 CI \u0433\u043e\u0442\u043e\u0432. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 <code>git push<\/code>, GitHub \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u043e \u044d\u0442\u0438\u043c \u0448\u0430\u0433\u0430\u043c.<\/p>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u043e\u043b\u0435\u0442\u043e\u0432: \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c?<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 BMI \u0432 \u0444\u0430\u0439\u043b\u0435 <code>main.py<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0431\u044b\u043b\u0438 \u0432\u043e\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u043e\u0441\u0442 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442) \u0438 \u0437\u0430\u043f\u0443\u0448\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442?<\/p>\n<ol>\n<li>\n<p>GitHub \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u0434 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0448\u0430\u0433\u0438 \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440 <code>ruff<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 (\u0442\u043e\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043d\u0435\u0442).<\/p>\n<\/li>\n<li>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043e <code>pytest<\/code>. \u041d\u0430\u0448 \u0442\u0435\u0441\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 <code>22.86<\/code>, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 <code>40.0<\/code>. \u0422\u0435\u0441\u0442 \u0443\u043f\u0430\u0434\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 GitHub:<\/strong> \u041e\u043d \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0440\u0432\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041e\u043a\u043e\u043b\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043a\u0440\u0435\u0441\u0442\u0438\u043a \u274c. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b Pull Request, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u044b, \u0438 \u0432\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432 \u043a \u0441\u043b\u0438\u044f\u043d\u0438\u044e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0437\u0430\u0433\u043e\u0440\u0438\u0442\u0441\u044f \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0433\u0430\u043b\u043e\u0447\u043a\u043e\u0439 \u2705, \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043d\u0430 100% \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2>5. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f: \u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c CI \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435<\/h2>\n<p>\u041d\u0430\u0448 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430: \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Python \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043d\u043e\u0432\u043e. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u0441\u044a\u0435\u0434\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c.<\/p>\n<h4>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (Matrix Strategy)<\/h4>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0438\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 open-source \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Python 3.11 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u2014 \u0432\u0434\u0440\u0443\u0433 \u0432 3.10 \u043d\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 \u0432\u0441\u0451 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f?<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0438\u043b\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432 GitHub Actions \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043c\u0430\u0442\u0440\u0438\u0446\u0430.<\/p>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u043b\u043e\u043a <code>strategy<\/code> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u0430 \u0432 \u0448\u0430\u0433\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Python \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>${{ matrix.python-version }}<\/code>.<\/p>\n<pre><code class=\"yaml\">jobs:  build-and-test:    runs-on: ubuntu-latest    strategy:      matrix:        python-version: [\"3.10\", \"3.11\", \"3.12\"] # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442:<\/strong> GitHub \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 <strong>\u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/strong> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0432\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0430 Python 3.10, 3.11 \u0438 3.12. \u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c (\u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0434\u0443\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e), \u0430 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0432\u0442\u0440\u043e\u0435.<\/p>\n<h4>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0437\u044b)<\/h4>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0448\u0430\u0433\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0441\u0442\u043d\u043e \u0438\u0434\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0445\u0438\u0432\u044b FastAPI, Pytest \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438\u0445. \u0412 \u043d\u0430\u0448\u0435\u043c \u043c\u0438\u043a\u0440\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0435\u043a\u0443\u043d\u0434 10-15. \u041d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441 Pandas, SQLAlchemy \u0438\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u044d\u0448. \u041f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u2014 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0448\u0435\u043d\u0430 <code>setup-python<\/code> \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 <code>cache: 'pip'<\/code> \u0432 \u043d\u0430\u0448 \u0448\u0430\u0433 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Python:<\/p>\n<pre><code class=\"yaml\">    steps:      - name: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434        uses: actions\/checkout@v4      - name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Python ${{ matrix.python-version }}        uses: actions\/setup-python@v5        with:          python-version: ${{ matrix.python-version }}          cache: 'pip' # &lt;-- \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u0430\u0433\u0438\u044e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c:<\/strong> \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 GitHub Actions \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0445 \u0432 \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0443 \u0441\u0435\u0431\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u00ab\u043a\u043b\u044e\u0447\u0430\u00bb \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0432\u0430 \u043e\u043d \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u0445\u0435\u0448 \u0432\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>requirements.txt<\/code>.<\/p>\n<p>\u041f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442: \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043b\u0438 <code>requirements.txt<\/code>? \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 (\u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043a\u043e\u0434 \u0432 <code>main.py<\/code>), \u043e\u043d \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u043d\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0437 \u043a\u044d\u0448\u0430. \u0428\u0430\u0433 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0434\u043e 1-2 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<h4>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Job<\/h4>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 <code>build-and-test<\/code> \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"yaml\">jobs:  build-and-test:    runs-on: ubuntu-latest    strategy:      matrix:        python-version: [\"3.10\", \"3.11\", \"3.12\"]    steps:      - name: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f        uses: actions\/checkout@v4      - name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Python ${{ matrix.python-version }}        uses: actions\/setup-python@v5        with:          python-version: ${{ matrix.python-version }}          cache: 'pip'      - name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438        run: |          python -m pip install --upgrade pip          pip install -r requirements.txt      - name: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c (Ruff)        run: ruff check .      - name: \u0417\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 (Pytest)        run: pytest<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>6. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c CD (\u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435)<\/h2>\n<p>\u0422\u0435\u0441\u0442\u044b \u0433\u043e\u0440\u044f\u0442 \u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b, \u043a\u043e\u0434 \u0432 \u0432\u0435\u0442\u043a\u0435 <code>main<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439. \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c. \u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0440\u0435\u043b\u0438\u0437\u044b \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430\u0445 \u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 FTP \u0438\u043b\u0438 SSH. \u042d\u0442\u043e \u0434\u043e\u043b\u0433\u043e, \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041c\u044b \u043f\u043e\u0440\u0443\u0447\u0438\u043c \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 GitHub.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c <strong>CD (Continuous Deployment)<\/strong>: \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (\u0442\u0435\u0433\u0430) GitHub \u0441\u0430\u043c \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u043b \u043d\u0430\u0448\u0435 FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Docker-\u043e\u0431\u0440\u0430\u0437 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0435\u0433\u043e \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 (Docker Hub), \u043e\u0442\u043a\u0443\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c.<\/p>\n<h4>\u0411\u0430\u0437\u043e\u0432\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435: Dockerfile<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437, \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0440\u044f\u0434\u043e\u043c \u0441 <code>requirements.txt<\/code>) \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0435\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>Dockerfile<\/code>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0441 \u043d\u0438\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e (\u0432\u0441\u0435\u0433\u043e 5 \u0441\u0442\u0440\u043e\u043a):<\/p>\n<pre><code>FROM python:3.11-slimWORKDIR \/appCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txtCOPY .\/src .\/srcCMD [\"uvicorn\", \"src.main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c: \u041f\u0440\u044f\u0447\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u0432 GitHub Secrets<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 Docker Hub \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0443 \u043d\u0443\u0436\u0435\u043d \u0432\u0430\u0448 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c. <strong>\u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u0438, \u0442\u043e\u043a\u0435\u043d\u044b \u0438\u043b\u0438 SSH-\u043a\u043b\u044e\u0447\u0438 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <\/strong><code><strong>.yml<\/strong><\/code><strong> \u0438\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435.<\/strong> \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c, \u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u2014 \u0438 \u0432\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0442\u0435\u043a\u0443\u0442.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 GitHub \u0435\u0441\u0442\u044c <strong>Secrets<\/strong> \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0439\u0444 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0432 GitHub.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <strong>Settings<\/strong> -&gt; \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e <strong>Secrets and variables<\/strong> -&gt; <strong>Actions<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0437\u0435\u043b\u0435\u043d\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 <strong>New repository secret<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0434\u0432\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p><strong>Name<\/strong>: <code>DOCKER_USERNAME<\/code> | <strong>Secret<\/strong>: \u0432\u0430\u0448 \u043b\u043e\u0433\u0438\u043d \u043d\u0430 Docker Hub.<\/p>\n<\/li>\n<li>\n<p><strong>Name<\/strong>: <code>DOCKER_TOKEN<\/code> | <strong>Secret<\/strong>: \u0432\u0430\u0448 Access Token (\u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Docker Hub, \u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430).<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/7c2\/39d\/736\/7c239d7366e17e7fbf9ba2f930a961f7.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/7c2\/39d\/736\/7c239d7366e17e7fbf9ba2f930a961f7.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/7c2\/39d\/736\/7c239d7366e17e7fbf9ba2f930a961f7.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u043a\u043e\u0434\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <code>${{ secrets.DOCKER_USERNAME }}<\/code>. \u0412 \u043b\u043e\u0433\u0430\u0445 GitHub \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043a\u0440\u044b\u0442\u044b \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430\u043c\u0438 <code>***<\/code>.<\/p>\n<h4>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0434\u0435\u043f\u043b\u043e\u044f: \u041f\u0438\u0448\u0435\u043c CD-\u0437\u0430\u0434\u0430\u0447\u0443<\/h4>\n<p>\u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u043b\u043a\u0438\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u0438\u0437 \u0432\u0435\u0442\u043a\u0438 <code>main<\/code>. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u2014 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043f\u043b\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0435\u043b\u0438\u0437 (\u0441\u043e\u0437\u0434\u0430\u0435\u043c Git-\u0442\u0435\u0433, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>v1.0.0<\/code>).<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0431\u043b\u043e\u043a <code>on<\/code> \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>ci.yml<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430 \u0442\u0435\u0433\u0438:<\/p>\n<pre><code class=\"yaml\">on:  push:    branches: [ \"main\" ]    tags: [ \"v*.*.*\" ] # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0435\u0433\u043e\u0432 \u0432\u0438\u0434\u0430 v1.0.0  pull_request:    branches: [ \"main\" ]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 (Job) \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0451 <code>build-and-push<\/code>.<\/p>\n<p><strong>\u0412\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/strong> CD \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 CI \u0443\u043f\u0430\u043b. \u041c\u044b \u0441\u0432\u044f\u0436\u0435\u043c \u044d\u0442\u0438 \u0434\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>needs<\/code>.<\/p>\n<pre><code class=\"yaml\">  # ... \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 build-and-test ...  build-and-push:    # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0422\u041e\u041b\u042c\u041a\u041e \u0435\u0441\u043b\u0438 build-and-test \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e    needs: build-and-test     # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0422\u041e\u041b\u042c\u041a\u041e \u0435\u0441\u043b\u0438 \u043f\u0443\u0448 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u0433 (\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u043c\u0438\u0442 \u0432 main)    if: startsWith(github.ref, 'refs\/tags\/')    runs-on: ubuntu-latest    steps:      - name: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434        uses: actions\/checkout@v4      # \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u043c\u0441\u044f \u0432 Docker Hub \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0438\u0445 \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432      - name: \u041b\u043e\u0433\u0438\u043d \u0432 Docker Hub        uses: docker\/login-action@v3        with:          username: ${{ secrets.DOCKER_USERNAME }}          password: ${{ secrets.DOCKER_TOKEN }}      # \u0412\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 Git-\u0442\u0435\u0433\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1.0.0), \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u043e\u0431\u0440\u0430\u0437      - name: \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0440\u0435\u043b\u0438\u0437\u0430 (\u0442\u0435\u0433)        id: get_version        run: echo \"VERSION=${GITHUB_REF#refs\/tags\/v}\" &gt;&gt; $GITHUB_ENV      # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u043f\u0443\u0448\u0438\u043c Docker-\u043e\u0431\u0440\u0430\u0437      - name: \u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 Docker-\u043e\u0431\u0440\u0430\u0437\u0430        uses: docker\/build-push-action@v5        with:          context: .          push: true          tags: |            ${{ secrets.DOCKER_USERNAME }}\/bmi-api:latest            ${{ secrets.DOCKER_USERNAME }}\/bmi-api:${{ env.VERSION }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0448 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u0442\u0435 <code>git push<\/code>. GitHub \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c (<code>build-and-test<\/code>). \u041b\u0438\u043d\u0442\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043a\u043e\u0434, \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0433\u043d\u0430\u043b\u0438\u0441\u044c. CD-\u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u043b\u0438\u0437.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0444\u0438\u0447 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0442\u0435\u0433: <code>git tag v1.0.0<\/code> \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440: <code>git push origin v1.0.0<\/code>.<\/p>\n<\/li>\n<li>\n<p>GitHub \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0437\u0430\u0433\u043e\u0440\u0430\u044e\u0442\u0441\u044f \u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 <code>build-and-push<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Docker Hub, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0437 <code>bmi-api<\/code> \u0438 \u0432\u0435\u0448\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u044f\u0440\u043b\u044b\u043a\u0430: <code>latest<\/code> (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f) \u0438 <code>1.0.0<\/code> (\u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f).<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0441\u0451. \u0412\u0430\u0448 \u0441\u0432\u0435\u0436\u0438\u0439, \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043b\u0435\u0436\u0438\u0442 \u0432 Docker Hub. \u041b\u044e\u0431\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u043c\u0438\u0440\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>docker pull<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h2>7. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0432\u0441\u0435 \u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438?<\/h2>\n<h4>\u042d\u0442\u0430\u043f 1. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0421I (\u0422\u0435\u0441\u0442\u044b \u0438 \u041b\u0438\u043d\u0442\u0435\u0440\u044b)<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043d\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 <code>Dockerfile<\/code> \u043d\u0430 GitHub.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">git add .git commit -m \"\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u043b\u043d\u044b\u0439 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0438 Dockerfile\"git push<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0427\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 GitHub \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <strong>Actions<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f. \u041d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong> \u0437\u0430\u0434\u0430\u0447\u0430 <code>build-and-test<\/code> (\u0441\u0440\u0430\u0437\u0443 3 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Python).<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 <code>build-and-push<\/code> (\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Docker) \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430. \u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0435\u0451, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u043c\u0438\u0442, \u0430 \u043d\u0435 \u0440\u0435\u043b\u0438\u0437. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>if: startsWith(github.ref, 'refs\/tags\/')<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e!<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/8d4\/ca7\/c98\/8d4ca7c98849904e4976a1dea18da5b1.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/8d4\/ca7\/c98\/8d4ca7c98849904e4976a1dea18da5b1.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/8d4\/ca7\/c98\/8d4ca7c98849904e4976a1dea18da5b1.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u042d\u0442\u0430\u043f 2. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c CD (\u0421\u0431\u043e\u0440\u043a\u0430 Docker-\u043e\u0431\u0440\u0430\u0437\u0430)<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u044b\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u044b\u043f\u0443\u0441\u043a \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (\u0440\u0435\u043b\u0438\u0437\u0430), \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c GitHub \u0441\u043e\u0431\u0440\u0430\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437.<\/p>\n<p>\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c Git-\u0442\u0435\u0433 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044f\u0440\u043b\u044b\u043a \u0432\u0435\u0440\u0441\u0438\u0438 (\u0442\u0435\u0433)git tag v1.0.0# \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u0442\u0435\u0433 \u043d\u0430 GitHubgit push origin v1.0.0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0427\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0441\u0435\u0439\u0447\u0430\u0441:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0438\u0434\u0438\u0442\u0435 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <strong>Actions<\/strong> \u0432 GitHub.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 (\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u043d\u043e \u0440\u044f\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u043e\u043a \u0431\u0438\u0440\u043a\u0438 <code>v1.0.0<\/code>).<\/p>\n<\/li>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0431\u0435\u0433\u0443\u0442 \u0442\u0435\u0441\u0442\u044b (<code>build-and-test<\/code>).<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u0441\u044f, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e <strong>\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0430\u0441\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430<\/strong> \u2014 <code>build-and-push<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043d\u0430 \u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043b\u043e\u0433\u0438. \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u0441\u044f \u0432 Docker Hub, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 <code>Dockerfile<\/code> \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u043e\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<h4>\u042d\u0442\u0430\u043f 3. \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 (\u0413\u0434\u0435 \u043c\u043e\u0439 \u043e\u0431\u0440\u0430\u0437?)<\/h4>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0433\u043e\u0440\u0438\u0442\u0441\u044f \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0433\u0430\u043b\u043e\u0447\u043a\u043e\u0439 \u2705, \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0435\u0442\u0435\u043b \u0434\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.<\/p>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 1: \u0427\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440<\/strong> \u0417\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <a href=\"https:\/\/hub.docker.com\/\" rel=\"noopener noreferrer nofollow\">hub.docker.com<\/a>, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c. \u0422\u0430\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <code>bmi-api<\/code>. \u0415\u0441\u043b\u0438 \u0437\u0430\u0439\u0442\u0438 \u0432 \u043d\u0435\u0433\u043e \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <strong>Tags<\/strong>, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0434\u0432\u0430 \u0442\u0435\u0433\u0430: <code>latest<\/code> \u0438 <code>1.0.0<\/code>.<\/p>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 2: \u0417\u0430\u043f\u0443\u0441\u043a \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435<\/strong> \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0432\u0435\u0436\u0438\u0439 \u043e\u0431\u0440\u0430\u0437 (\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 <code>\u0412\u0410\u0428_\u041b\u041e\u0413\u0418\u041d<\/code> \u043d\u0430 \u043b\u043e\u0433\u0438\u043d \u043e\u0442 Docker Hub):<\/p>\n<pre><code class=\"bash\">docker run -p 8000:8000 \u0412\u0410\u0428_\u041b\u041e\u0413\u0418\u041d\/bmi-api:1.0.0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 Docker \u0441\u043a\u0430\u0447\u0430\u043b \u043e\u0431\u0440\u0430\u0437, \u0438 \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440 Uvicorn \u2014 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e! \u0412\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439, \u0440\u0430\u0431\u043e\u0447\u0438\u0439 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d.<\/p>\n<h3>8. \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0441\u044f \u044d\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043c\u0435\u043b\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0432\u0435\u0449\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 GitHub: \u0437\u0430\u0439\u0442\u0438 \u0432 <em>Settings -&gt; Branches -&gt; Add branch protection rule<\/em>, \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0442\u043a\u0443 <code>master<\/code> \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 <strong>Require status checks to pass before merging<\/strong> \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 <code>build-and-test<\/code>.<\/p>\n<p>\u0412\u0441\u0451. \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043b\u0438\u0442\u044c \u0441\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u2014 GitHub \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043b\u0438\u044f\u043d\u0438\u044f (Merge), \u043f\u043e\u043a\u0430 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043d\u0435 \u0437\u0430\u0433\u043e\u0440\u0438\u0442\u0441\u044f \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0433\u0430\u043b\u043e\u0447\u043a\u043e\u0439.<\/p>\n<p><strong>\u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0438\u0442\u043e\u0433\u0435:<\/strong> \u0417\u0430 \u043f\u0430\u0440\u0443 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0432\u0441\u044e \u0440\u0443\u0442\u0438\u043d\u0443. \u041e\u043d \u0441\u0430\u043c \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u043e\u0439 \u043a\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 <code>ruff<\/code>, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0433\u043e\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0442\u0440\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Python, \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 Docker-\u043e\u0431\u0440\u0430\u0437\u044b \u043f\u0440\u0438 \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u0412\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434, \u0430 \u0440\u043e\u0431\u043e\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>\u0410\u043d\u043e\u043d\u0441\u044b \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0438\u0445 \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/t.me\/+NlTdqmVuBkIzMDBi\" rel=\"noopener noreferrer nofollow\"><strong>\u043c\u043e\u0451\u043c Telegram-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435<\/strong><\/a>. \u0421\u043c\u0435\u043b\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a, \u2014 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a \u0438 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0444\u0430\u0439\u043b <code>ci.yml<\/code> \u043c\u043e\u0436\u043d\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438: <a href=\"https:\/\/github.com\/Zaplavs\/bmi_project\" rel=\"noopener noreferrer nofollow\">github.com\/Zaplavs\/bmi_project<\/a>.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1037002\/\">https:\/\/habr.com\/ru\/articles\/1037002\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435CI\/CD \u2014 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430.\u0415\u0441\u043b\u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0442\u0435\u043e\u0440\u0438\u0438, \u0442\u043e:CI (Continuous Integration \/ \u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u043d \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0441 \u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438. \u0426\u0435\u043b\u044c \u2014 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b.CD (Continuous Deployment \/ \u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435) \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0434\u0435\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 CI \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u041a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u2014 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0432 Docker Hub \u0438\u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0432 PyPI.\u0417\u0430\u0447\u0435\u043c CI\/CD \u043d\u0443\u0436\u0435\u043d \u0432 Python-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445Python \u2014 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0439\u043c\u0430\u043b \u0431\u044b \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0441\u044a\u0435\u0445\u0430\u0432\u0448\u0438\u0439 \u043e\u0442\u0441\u0442\u0443\u043f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 CI\/CD \u0432 Python-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u0440\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0443\u0442\u0438\u043d\u044b. \u0412\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c pytest, black, isort \u0438\u043b\u0438 flake8. \u0412\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0435 push. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440.\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432 \u043a\u043e\u0434\u0430 (PEP8). \u0412 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 (main\/master) \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0441\u0442\u0438\u043b\u044c \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e. \u042d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0447\u0430\u0441\u044b \u043d\u0430 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e \u2014 \u043b\u044e\u0434\u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u044e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0430 \u043d\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u0440\u043e\u043a.\u0423\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u00ab\u0410 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00bb. \u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c, \u0447\u0438\u0441\u0442\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0432 requirements.txt \u0438\u043b\u0438 pyproject.toml, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0441\u0440\u0430\u0437\u0443 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 ModuleNotFoundError, \u0438 \u0432\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u044d\u0442\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043a\u043e\u0434 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d.\u041f\u043e\u0447\u0435\u043c\u0443 GitHub Actions\u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043c\u043d\u043e\u0433\u043e CI\/CD \u0441\u0438\u0441\u0442\u0435\u043c: GitLab CI, Jenkins, CircleCI. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u0436\u0438\u0432\u0435\u0442 \u043d\u0430 GitHub, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GitHub Actions \u2014 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0430\u0433\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb. \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0430\u0440\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u043d\u043d\u0435\u0440\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u0431\u0445\u0443\u043a\u0438 (\u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Jenkins). \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c YAML-\u0444\u0430\u0439\u043b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e .github\/workflows\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u043c\u043e.\u0429\u0435\u0434\u0440\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b. GitHub \u0434\u0430\u0435\u0442 2000 \u043c\u0438\u043d\u0443\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432. \u0414\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 open-source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e. \u0414\u043b\u044f \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.\u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438. \u0412 GitHub Marketplace \u0435\u0441\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u044d\u043a\u0448\u0435\u043d\u043e\u0432 (\u0448\u0430\u0433\u043e\u0432). \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c bash-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Python, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u0434\u0435\u043f\u043b\u043e\u044f \u043f\u043e SSH \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 2-3 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430.2. \u041d\u0430\u0448 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c CI\/CD \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439, \u0445\u043e\u0442\u044c \u0438 \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 FastAPI, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043c\u0430\u0441\u0441\u044b \u0442\u0435\u043b\u0430 (BMI). \u041e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0435\u0441 \u0438 \u0440\u043e\u0441\u0442, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441.\u0427\u0442\u043e \u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0412\u043e\u0442 \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0442\u0440\u043e\u043a \u0438 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 src\/main.py:from fastapi import FastAPI, HTTPExceptionapp = FastAPI()@app.get(&#171;\/bmi&#187;)def calculate_bmi(weight: float, height: float):    if height &lt;= 0 or weight &lt;= 0:        raise HTTPException(status_code=400, detail=&#187;\u0420\u043e\u0441\u0442 \u0438 \u0432\u0435\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f&#187;)        bmi = weight \/ (height ** 2)    return {&#171;weight&#187;: weight, &#171;height&#187;: height, &#171;bmi&#187;: round(bmi, 2)}\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0430\u0434\u0430\u0435\u0442, \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 tests\/test_main.py:from fastapi.testclient import TestClientfrom src.main import appclient = TestClient(app)def test_calculate_bmi_success():    # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0432\u0435\u0441\u043e\u043c 70 \u043a\u0433 \u0438 \u0440\u043e\u0441\u0442\u043e\u043c 1.75 \u043c    response = client.get(&#171;\/bmi?weight=70&amp;height=1.75&#187;)    assert response.status_code == 200    assert response.json()[&#171;bmi&#187;] == 22.86\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u041d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0424\u0430\u0439\u043b\u044b \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u043f\u0430\u043f\u043a\u0430\u043c, \u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:bmi_project\/\u251c\u2500\u2500 requirements.txt       # \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b fastapi, uvicorn, pytest, httpx \u0438 ruff\u251c\u2500\u2500 src\/\u2502   \u251c\u2500\u2500 __init__.py\u2502   \u2514\u2500\u2500 main.py            # \u041d\u0430\u0448 API\u2514\u2500\u2500 tests\/    \u251c\u2500\u2500 __init__.py    \u2514\u2500\u2500 test_main.py       # \u041d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b\u0420\u0443\u0447\u043d\u0430\u044f \u0440\u0443\u0442\u0438\u043d\u0430 (\u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f)\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0444\u0438\u0447\u0443 \u0432 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u0432 GitHub (\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 git push), \u0432\u044b \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0432\u0432\u043e\u0434\u0438\u0442\u0435 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0432\u0434\u0440\u0443\u0433 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443):pip install -r requirements.txt\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043b\u0438\u043d\u0442\u0435\u0440 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 ruff), \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 PEP8:    ruff check .\u041f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u0430\u0441\u044c:    pytest\u0418 \u0442\u0430\u043a \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0431\u0443\u0434\u0435\u0442\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c? \u0418\u043b\u0438 \u043f\u043e\u043b\u0435\u043d\u0438\u0442\u0435\u0441\u044c? \u041f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434 \u0443\u043b\u0435\u0442\u0438\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435.\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 GitHub \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435. \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u043e\u0431\u043e\u0442.\u041e\u0439, \u0432\u0438\u0436\u0443 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 Markdown \u0441\u043b\u043e\u043c\u0430\u043b\u0430\u0441\u044c \u2014 \u044f \u0437\u0430\u0431\u044b\u043b \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 &#171;&#171;`, \u0438 \u0432\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0443\u043b\u0435\u0442\u0435\u043b \u0432\u043d\u0443\u0442\u0440\u044c. \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438! \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0441\u044c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.3. \u041f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d (\u0411\u0430\u0437\u043e\u0432\u044b\u0439 CI)\u0427\u0442\u043e\u0431\u044b GitHub \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u044b \u043e\u0442 \u043d\u0435\u0433\u043e \u0445\u043e\u0442\u0438\u043c, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. GitHub Actions \u0438\u0449\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435: \u0432 \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 .github\/workflows\/ \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043c \u0444\u0430\u0439\u043b \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e ci.yml (\u0438\u043c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 .yml).\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043a\u0435\u043b\u0435\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430:name: API CI\/CD# 1. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c (Triggers)on:  push:    branches: [ &#171;main&#187; ]  pull_request:    branches: [ &#171;main&#187; ]# 2. \u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c (Jobs)jobs:  build-and-test:    runs-on: ubuntu-latest # \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Linux    # 3. \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f (Steps)    steps:      &#8212; name: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f        uses: actions\/checkout@v4      &#8212; name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Python 3.11        uses: actions\/setup-python@v5        with:          python-version: &#171;3.11&#187;      &#8212; name: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438        run: |          python -m pip install &#8212;upgrade pip          pip install -r requirements.txt\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u0434 \u043f\u043e \u043a\u043e\u0441\u0442\u043e\u0447\u043a\u0430\u043cname: \u0418\u043c\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 GitHub \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u00abActions\u00bb.on: \u042d\u0442\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440. \u041c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c: \u00abGitHub, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u043f\u0443\u0448\u0438\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0432\u0435\u0442\u043a\u0443 main \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432 \u043d\u0435\u0435 Pull Request\u00bb.jobs: \u0417\u0430\u0434\u0430\u0447\u0438. \u041f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043c\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u0435\u0451 build-and-test.runs-on: ubuntu-latest: GitHub \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0447\u0438\u0441\u0442\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Ubuntu.steps: \u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u042d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0448\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c:actions\/checkout@v4 \u2014 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u044d\u043a\u0448\u0435\u043d (action). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0443\u0441\u0442\u043e\u0439. \u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443.actions\/setup-python@v5 \u2014 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u044d\u043a\u0448\u0435\u043d. \u041e\u043d \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Python (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 3.11).run \u2014 \u0430 \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0420\u043e\u0432\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e: \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c pip \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c fastapi, pytest \u0438 ruff \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.4. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: \u0422\u0435\u0441\u0442\u044b \u0438 \u041b\u0438\u043d\u0442\u0435\u0440\u044b\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u043e\u0442\u043e\u0432, \u043d\u0430 \u043d\u0435\u043c \u043b\u0435\u0436\u0438\u0442 \u043d\u0430\u0448 \u043a\u043e\u0434 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b ci.yml. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0431\u043b\u043e\u043a\u0430 steps \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u0432\u043e\u0434\u0438\u043b\u0438 \u0440\u0443\u043a\u0430\u043c\u0438:      &#8212; name: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c (Ruff)        run: ruff check .      &#8212; name: \u0417\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 (Pytest)        run: pytest\u0412\u0441\u0451, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 CI \u0433\u043e\u0442\u043e\u0432. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 git push, GitHub \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u043e \u044d\u0442\u0438\u043c \u0448\u0430\u0433\u0430\u043c.\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u043e\u043b\u0435\u0442\u043e\u0432: \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c?\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 BMI \u0432 \u0444\u0430\u0439\u043b\u0435 main.py (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0431\u044b\u043b\u0438 \u0432\u043e\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u043e\u0441\u0442 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442) \u0438 \u0437\u0430\u043f\u0443\u0448\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442?GitHub \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u0434 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0448\u0430\u0433\u0438 \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e).\u041b\u0438\u043d\u0442\u0435\u0440 ruff \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 (\u0442\u043e\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043d\u0435\u0442).\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043e pytest. \u041d\u0430\u0448 \u0442\u0435\u0441\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 22.86, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 40.0. \u0422\u0435\u0441\u0442 \u0443\u043f\u0430\u0434\u0435\u0442.\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 GitHub: \u041e\u043d \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0440\u0432\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041e\u043a\u043e\u043b\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043a\u0440\u0435\u0441\u0442\u0438\u043a \u274c. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b Pull Request, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u044b, \u0438 \u0432\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432 \u043a \u0441\u043b\u0438\u044f\u043d\u0438\u044e.\u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0437\u0430\u0433\u043e\u0440\u0438\u0442\u0441\u044f \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0433\u0430\u043b\u043e\u0447\u043a\u043e\u0439 \u2705, \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043d\u0430 100% \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.5. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f: \u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c CI \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u041d\u0430\u0448 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430: \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Python \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043d\u043e\u0432\u043e. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u0441\u044a\u0435\u0434\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c.\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (Matrix Strategy)\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0438\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 open-source \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Python 3.11 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u2014 \u0432\u0434\u0440\u0443\u0433 \u0432 3.10 \u043d\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 \u0432\u0441\u0451 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f?\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0438\u043b\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432 GitHub Actions \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043c\u0430\u0442\u0440\u0438\u0446\u0430.\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u043b\u043e\u043a strategy \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u0430 \u0432 \u0448\u0430\u0433\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Python \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e ${{ matrix.python-version }}.jobs:  build-and-test:    runs-on: ubuntu-latest    strategy:      matrix:        python-version: [&#171;3.10&#187;, &#171;3.11&#187;, &#171;3.12&#187;] # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442: GitHub \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0432\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0430 Python 3.10, 3.11 \u0438 3.12. \u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c (\u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0434\u0443\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e), \u0430 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0432\u0442\u0440\u043e\u0435.\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0437\u044b)\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0448\u0430\u0433\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0441\u0442\u043d\u043e \u0438\u0434\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0445\u0438\u0432\u044b FastAPI, Pytest \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438\u0445. \u0412 \u043d\u0430\u0448\u0435\u043c \u043c\u0438\u043a\u0440\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0435\u043a\u0443\u043d\u0434 10-15. \u041d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441 Pandas, SQLAlchemy \u0438\u043b\u0438 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-480292","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480292"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480292\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}