We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
A CI/CD Pipeline is one of the key tools software engineers have to produce high quality software. It stands for Continuous Integration (CI) and Continuous Delivery (CD). The idea being that instead of making a bunch of changes to your software and then pulling it all together to test it at the end, you should continuously integrate (test) and release (deploy) your software to find bugs faster.
Like many people, I store my software source code on GitHub. A few years ago I set up a simple CI/CD pipeline in GitHub to build, analyze, and test my web app/web services. It worked fine and since it was the first time I had set up a CI/CD pipeline in GitHub I kept it simple with essentially only one step.
- build (and deploy)
Over time, though, I found myself shying away from making changes to my software. As a developer with ADHD, I sometimes find that I have issues getting things done when there are multiple hurdles involved, and I realized that one of the things that was causing me problems was the fact that my CI/CD pipeline took 5 minutes to run. Every time I wanted to make a change, I would have to code it up and then go make a cup of coffee while I waited for the pipeline to test and deploy the code. I wouldn't always make it back. Often times I would get distracted.
For reference, when I started I was doing these things in 5.5 minutes:
- building
- purgecss
- stylelint (css)
- html-validate
- yamllint
- SCA vulnerability scanning (go vuln)
- 2 go linters (staticcheck and golangci-lint)
- packaging the app, including nginx configs, into a deployable zip
- running nearly unit and integration 200 tests
I decided that 1 minute was the maximum I was willing to wait for my code to test and deploy.
Here's what I did to optimize my CICD pipeline:
- split action into multiple parallel jobs
- use github caching
- optimize my linting
- tweak the jobs to fit together
Even though my app is a golang app, I feel these techniques should work for any programming language.
continue reading on mzfit.app
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.