CI/CD for https://github.com/helixml/apps-client/

Workflow

This workflow defines the automated build, test, and release process for the apps-client project.

publish.yaml

This workflow (publish.yaml) defines the steps for building, testing, and releasing the library.

Key Steps:

  1. Checkout Code: Fetches the latest code from the repository.
  2. Install Dependencies: Installs all necessary dependencies (e.g., TypeScript compiler, testing frameworks).
  3. Build: Compiles the TypeScript code into JavaScript.
  4. Test: Runs unit tests to ensure code functionality.
  5. Lint: Uses linters to check code style and potential issues.
  6. Package: Creates a distributable package for the library.
  7. Publish: Deploys the packaged library to a specified repository (e.g., npm, GitHub Packages).

Examples

Triggering a Release:

To trigger a release, you can manually trigger the workflow through the GitHub UI or configure it to automatically trigger on specific events (e.g., push to the main branch).

Example: Triggering a Release on Push to main:

on:
            push:
              branches:
                - main
          

Publishing to a Repository:

The workflow can be configured to publish the library to different repositories.

Example: Publishing to npm:

jobs:
            publish:
              runs-on: ubuntu-latest
              steps:
                - uses: actions/checkout@v3
                - uses: actions/setup-node@v3
                  with:
                    node-version: '16'
                - run: npm ci
                - run: npm run build
                - run: npm run test
                - run: npm run lint
                - run: npm publish
          

Code Quality Checks

The workflow includes steps for performing code quality checks using linters and automated tests.

Example: Using ESLint for Linting:

jobs:
            lint:
              runs-on: ubuntu-latest
              steps:
                - uses: actions/checkout@v3
                - uses: actions/setup-node@v3
                  with:
                    node-version: '16'
                - run: npm ci
                - run: npm run lint
          

Automated Testing

The workflow runs unit tests to ensure code functionality.

Example: Running Jest Tests:

jobs:
            test:
              runs-on: ubuntu-latest
              steps:
                - uses: actions/checkout@v3
                - uses: actions/setup-node@v3
                  with:
                    node-version: '16'
                - run: npm ci
                - run: npm run test