{
"$type": "site.standard.document",
"canonicalUrl": "https://rednafi.com/python/github-action-template-python/",
"description": "Production-ready GitHub Actions workflow for Python with multi-OS testing, dependency caching, automated updates, and daily scheduled runs.",
"path": "/python/github-action-template-python/",
"publishedAt": "2022-03-02T00:00:00.000Z",
"site": "at://did:plc:fgtm2c26vfcj74rfmeggbyqj/site.standard.publication/3mnl6f7ob462z",
"tags": [
"Python",
"GitHub",
"DevOps"
],
"textContent": "Five traits that almost all the GitHub Action workflows in my Python projects share are:\n\n- If a new workflow is triggered while the previous one is running, the first one will get\n canceled.\n- The CI is triggered every day at UTC 1.\n- Tests and the lint-checkers are run on Ubuntu and MacOS against multiple Python versions.\n- Pip dependencies are cached.\n- Dependencies, including the Actions dependencies are automatically updated via\n [Dependabot].\n\nI use [pip-tools] for managing dependencies in applications and [setuptools] setup.py\ncombo for managing dependencies in libraries. Here's an annotated version of the template\naction syntax:\n\nThe dependabot config looks as follows:\n\nFurther reading\n\n- [An active version of the above workflow]\n\n\n\n\n[dependabot]:\n https://github.com/dependabot\n\n[pip-tools]:\n https://github.com/jazzband/pip-tools\n\n[setuptools]:\n https://github.com/pypa/setuptools\n\n[an active version of the above workflow]:\n https://github.com/rednafi/stress-test-locust/blob/master/.github/workflows/build_test.yml",
"title": "Github action template for Python based projects"
}