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

Add a GitHub Actions workflow for pull request builds. #5

Conversation

phamann
Copy link
Collaborator

@phamann phamann commented Jul 27, 2020

⚠️ Note: this is a PR into create-provider-hooks and not master/main

TL;DR

Adds a Github Actions CI workflow for pull requests.

Why?

This gives us confidence that new changes will cleanly integrate into the main branch, give us fast feedback mechanisms for linting, testing, compilation and ensures documentation is up-to-date.

I went with Actions over, Travis, Circle CI etc due to its simplicity and first-class integration within the GitHub UI and its free for open-source projects.

What?

The workflow is broken down into four self contained jobs which run concurrently on every push to a pull request: lint, test, build, and docs.

Each job consists of the same boilerplate checkout, install node and load npm cache (which unfortunately can't be shared across jobs until this issue is fixed later this year: actions/runner#438 (comment)). All jobs run on a ubuntu image with node 12.x, however I left in a matrix for node versions if we want to test on more than one in the future.

I'm using npm ci instead of npm install which should lead to faster builds and it loads the cache for ~/.npm from previous build based on the hash of the package-lock.json contents.

  • lint runs npm run lint and will catch linting errors
  • test runs npm run test and will catch test failures
  • build runs npm run build:dev and will catch compilation errors. note: this should be changed to npm run build:prod when it exists.
  • docs runs npm run build:doc and then validates whether the git tree is clean. This will ensure contributors always commit any updated documentation changes.

Copy link
Collaborator

@jakewan jakewan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds and looks great!

@jakewan jakewan merged commit e4b9499 into openinsights:create-provider-hooks Jul 27, 2020
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.

2 participants