Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract workflows from build job to new lint and test jobs #1

Merged
merged 8 commits into from
Apr 17, 2024

Conversation

cfisher-scottlogic
Copy link
Owner

@cfisher-scottlogic cfisher-scottlogic commented Apr 4, 2024

Context

Related to #1807. Pull requests into master have been experiencing build failures. These failures are due to errors thrown by commitlint. This PR aims to make the linting process of the CI pipeline more explicit so contributors can more easily identify issues with their code.

Description

This PR divides the current monalithic 'build' workflow (build.yml) and job (build) into a development workflow (development.yml) with distinct 'build and test' and 'code standards' jobs. To make the workflow names consistent, npm-publish.yml has been renamed to release.yml, and has a dependency on development.yml running prior to publishing the package(s) within the publish-npm job.

Changes in the codebase

  1. Rename build.yml to development.yml
  2. Rename npm-publish.yml to release.yml
  3. Separate 'build, test, lint' into 'build and test' (with npm run bundle, npm run bundle-min, npm test), and 'code standards' (with npm run commitlint and npm run lint)
  4. Give jobs names (e.g. build-test / Build and test)
  5. Give steps within jobs names (e.g. "Checkout repository")

Additional information

The ideal setup was to have separate workflow files for linting, building, testing. Separate workflow files would show up as separate 'checks' on the main page of the PR, which would make failures immediately obvious. However, it's very difficult to get these workflows into separate files without lots of complicated dependencies, repetitive actions and storing of build artifacts, which creates unnecessary computational overhead. The approach taken here to at least create distinct jobs within the workflow files makes it easier to see the jobs within the PR checks tab at the very least, rather than just 'build failure'.

Screenshots

Some screenshots illustrating visibility of CI flows.

Before
image
image

After
image
image

@cfisher-scottlogic cfisher-scottlogic marked this pull request as ready for review April 4, 2024 14:00
@cfisher-scottlogic cfisher-scottlogic changed the title Extract lint workflows from build job to new lint job Extract workflows from build job to new lint and test jobs Apr 4, 2024
@cfisher-scottlogic cfisher-scottlogic merged commit 537f201 into master Apr 17, 2024
1 of 2 checks passed
@cfisher-scottlogic cfisher-scottlogic deleted the new-lint-job branch April 17, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant