Crafting a CI Pipeline: My Experience with GitHub Actions, Python & AWS

<p>Integrating code consistently and ensuring it meets best practices is challenging but essential. Today, I aim to share a reliable GitHub Actions setup that I&rsquo;ve tailored specifically for Python Serverless projects on AWS. Additionally, I&rsquo;ll introduce a Makefile I&rsquo;ve designed to streamline task management. Armed with these tools, our goal is to craft software that&rsquo;s both well-crafted and robust.</p> <p>Let&rsquo;s go!</p> <blockquote> <p>CI pipeline we are going to build will be relying on poetry: if you aren&rsquo;t already using it, I highly recommend giving it a glance.&nbsp;<a href="https://python-poetry.org/" rel="noopener ugc nofollow" target="_blank">Poetry</a>&nbsp;is a remarkable tool that provides a seamless way to manage dependencies, and ensuring a unified and reproducible build environment.</p> </blockquote> <h2>The Magic of the &ldquo;Makefile&rdquo;</h2> <p>While the Makefile isn&rsquo;t frequently associated with the Python ecosystem, it&rsquo;s an invaluable asset when it comes to task simplification. The Makefile we&rsquo;ll be discussing not only facilitates executing commands on our local setup but also streamlines operations in both our CI and upcoming CD pipeline.</p> <p>In our Makefile we will focus on:</p> <ul> <li><strong><em>Initialising our local environment.</em></strong></li> <li><strong><em>Reformatting code.&nbsp;</em></strong>It&rsquo;s crucial to ensure our code adheres to PEP standards, along with the unique coding norms set by our team.</li> <li><strong><em>Linting.&nbsp;</em></strong>Linting conducts a static analysis to pinpoint potential discrepancies related to the use of mismatched or incorrect data types. This preemptive measure averts runtime errors, leading to a hassle-free development cycle and a more robust end product.</li> <li><strong><em>Executing Tests.</em></strong></li> <li><strong><em>Auditing&nbsp;</em></strong>our codebase to uncover possible security risks.</li> </ul> <p>By including these tasks, we streamline the setup and upkeep of our codebase. It becomes less arduous for developers to chip in and work together.</p> <p><a href="https://medium.com/@dkraczkowski/crafting-a-ci-pipeline-my-experience-with-github-actions-python-aws-c67f428adee8">Website</a></p>