Skip to content

hoverkraft-tech/ci-github-nodejs

Continuous Integration - GitHub - Node.js

Continuous Integration GitHub tag License PRs Welcome

Opinionated GitHub Actions and reusable workflows for Node.js continuous integration pipelines.


Overview

This repository centralizes the Hoverkraft toolkit for building, testing, and shipping Node.js projects on GitHub. It bundles:

  • Composite actions that detect project tooling, manage dependencies, and bootstrap runtimes.
  • Reusable workflows that apply those actions to deliver consistent CI pipelines across repositories.

Actions

CI Actions

Actions for continuous integration steps: build, lint, and test.

Dependencies

Actions dedicated to caching and validating Node.js dependencies.

Environment setup

Actions focused on discovering and preparing the Node.js environment.

Reusable Workflows

Continuous Integration

Contributing

Contributions are welcome! Please review the contributing guidelines before opening a PR.

Action Structure Pattern

All actions follow a consistent layout:

actions/{category}/{action-name}/
├── action.yml          # Action definition with inputs/outputs
├── README.md           # Usage documentation and examples
└── index.js / scripts  # Optional Node.js helpers (when required)

Development Standards

Action Definition Standards

  1. Consistent branding: Use author: hoverkraft with color: blue and a meaningful icon.
  2. Pinned dependencies: Reference third-party actions via exact SHAs to guarantee reproducibility.
  3. Input validation: Validate critical inputs early within composite steps or supporting scripts.
  4. Idempotent steps: Ensure actions can run multiple times without leaving residual state in the workspace.
  5. Multi-platform support: Test actions in both ubuntu-latest and windows-latest runners when applicable.
  6. Cross-platform compatibility: Uses actions/github-script steps for cross-platform compatibility. Avoid run steps.
  7. Logging: Use structured logs with clear prefixes ([build-image], [helm-test-chart], …) to simplify debugging.
  8. Security: Avoid shell interpolation with untrusted inputs; prefer parameterized commands or set -euo pipefail wrappers.

File Conventions

  • Tests: Located in tests/ with fixtures for container builds and chart-testing scenarios.
  • Workflows: Reusable definitions live in .github/workflows/; internal/private workflows are prefixed with __.

JavaScript Development Patterns

  • Encapsulate reusable logic in modules under the action directory (for example, actions/my-action/index.js).
  • Prefer async/await with explicit error handling when interacting with the GitHub API or filesystem.
  • Centralize environment variable parsing and validation to keep composite YAML lean.

Development Workflow

Linting & Testing

make lint                 # Run the dockerized Super Linter
make lint-fix             # Attempt auto-fixes for lint findings

Author

🏢 Hoverkraft contact@hoverkraft.cloud

License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2023 Hoverkraft.

For more details, see the license.

About

Opinionated Github actions and workflows for continuous integration in NodeJs context

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 5