Tn improve GitHub actions
(NOTE: test pipeline is currently failing because the previous PR to fix flake8-bandit is not part of main yet.)
- Implement github action workflows with similar evolved behavior to the gitlab ci
- Dockerise the application for testing
- Cache the docker images for faster rebuild
- Use same tagging strategy as in the gitlab ci, both for CI and App docker images
- Upload mypy and pytest results as artifacts only on testing failure as in gitlab ci instead of not uploading those artifacts at all
- Upload
coverageresult as an artifact (previously, the purpose was apparently to send thecoverageresult to Codecov, but failed because Codecov requires a priced account and tokens to connect to it) - Enforce successful
Testworkflow before manual triggering ofDeployworkflow - Set-up
feature,test,development,acceptance,productionenvironments that get integrated with github web interface (similarly to what we achieve in gitlab ci) - Prevent
Deployworkflow from running onacceptanceandproductionenvironments if not tagged (similarly to what we achieve in gitlab ci) - Prevent
Publishworkflow from running ifTestworkflow failed in github actions - Run
Publishworkflow poetry commands in the docker image
- Put emphasis on one tricky part of the readme installation steps
- Refactor
DOCKER_PUSHvariable into more understandableDOCKER_BUILD_PUSH - Ensure
DOCKER_BUILD_PUSHis set to 1 when deploying so App image building, tagging and pushing gets triggered. - Remove pip dependabot, as it doesn't follow the allowed bumping strategy defined for each package in the
pyproject.toml. For instance, it will try to major version a package, even if the package strategy in thepyproject.tomlis set to not bump, bump patch or bump minor
Hey @tanguyNaets, thanks for this PR! It's a pretty big one, so it will take some time to go through this in detail. Are there any smaller parts you could spin out into a separate PR so that we can get those improvements merged quicker already?
In addition to the main goal of the PR (improve github actions), I could have the following PRs:
- Small edit of the readme to put emphasis on an easily missed step (1 line change)
- Remove pip from github's dependabot (3 lines removed)
- Leverage properly sentry: I can probably remove that one now that you are tackling it in your sentry PR. I'll need a bit of refactoring to remove the changes related to that bit of the PR.
Apart for the 3rd one, is it really worth it for you having 1 and 2 in separate PRs? If so, I'll split them. LMK
I removed the 3rd one since sentry is now a generic feature. RFR
I removed the 3rd one since sentry is now a generic feature. RFR
Related: https://github.com/radix-ai/poetry-cookiecutter/pull/63
Closing this PR as we've recently reworked the CI/CD pipelines in https://github.com/radix-ai/poetry-cookiecutter/pull/206.