Skip to content

CI Pipeline

Steven edited this page May 28, 2024 · 4 revisions

GitHub Action

Description

The CI pipeline runs on pushing on main and opening, reopening and updating pull requests on main. It compiles SCSS, uses Prettier to format the code, lints the code and runs all tests on the feature branch from which the pull request was opened. This ensures consistent CSS files, code formatting and code quality.


Steps

checkout repo

  • checks out the branch from which the pull request was opened with ${{ github.head_ref }}

use node.js

  • use the right node version for npm and npx commands

install dependencies

  • install sass compiler for scss action
  • install the packages dependencies

compile SCSS

run the common-js script compile-scss.cjs:

  • recursively traverse the whole frontend folder to find and compile any .scss files to .css files in their own respective subdirectory
  • throw either info or error messages

commit compiled SCSS

  • force add .css files
  • check if there are changes to commit and commit or print a message
  • use username github-actions[bot]
  • use email address github-actions[bot]@users.noreply.github.com

prettier

  • autoformat code using npx prettier . --write (reformats all files in the /frontend directory and writes them)

commit prettier changes

  • check if there are changes to commit and commit or print a message
  • use username github-actions[bot]
  • use email address github-actions[bot]@users.noreply.github.com

lint

  • executes npm run lint

run tests

  • executes npm run test

push changes

  • checks if there are commits to push and pushes them to the feature branch with git push origin ${{ github.head_ref }} or shows a message

Questions regarding CI Pipeline: @MysterionAutotronic, @cwsyth