This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by TD
Overview
For Lab 9, I was tasked with adding continuous integration to Siteit - an SSG tool that parses markdown and text files and renders results in HTML files.
I could have chosen other popular options, such as Travis CI, to integrate continuous integration, but since Siteit is already on GitHub, I decided to integrate CI using only GitHub Actions.
Initial Workflow
My initial workflow file was pretty simple, as I had one "build" job
that did more than just building. It also ran linter, formatter, and unit tests. Everything seemed to work as expected until I looked at how my lab partner had integrated his CI workflow.
Making Improvements
My lab partner had sectioned jobs
based on their purpose. This approach seemed more logical, and I realized I could improve my CI workflow without running all scripts as part of the build job. Therefore, I decided to refactor my workflow by adding the following jobs:
- linter
- formatter
- tests
The job
names implies the function of each job
.
For instance, linter runs checks for linting errors using eslint
and fixes them. On the other hand, formatter runs checks for formatting using prettier
and corrects them. Finally, tests runs unit tests using the jest
framework.
To view CI workflow implementation for Siteit, click here.
Final Thoughts
Implementing Continuous Integration using GitHub Actions was an overall fun experience. I got to familiarize myself with the YAML syntax and gain valuable experience using GitHub Actions.
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by TD
TD | Sciencx (2022-11-26T23:08:52+00:00) OSD600: Adding CI to Siteit. Retrieved from https://www.scien.cx/2022/11/26/osd600-adding-ci-to-siteit/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.