Skip to content

Commit

Permalink
ci: improve GitHub Actions workflow descriptions (#57)
Browse files Browse the repository at this point in the history
* ci: simplify and standardize pipelines

1. Upgrade node version in release.yml
2. Merge 'ci.yml' and 'code-quality.yml'
3. Remove node-cache since the project is not complex enough for it to
   be required

* ci: improve GitHub Actions workflow descriptions

- Made workflow and job names more descriptive
- Added detailed step descriptions for better visibility in GitHub UI
- Clarified tools being used (Biome, TypeScript) in step names
- Improved build step description to indicate production build
  • Loading branch information
supitsdu authored Nov 27, 2024
1 parent 338acef commit d47565e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 74 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,47 @@
name: CI
name: Build, Test & Quality Checks

on:
push:
branches:
- main
branches: [main]
pull_request:
branches:
- main
branches: [main]

jobs:
build:
name: Test & Build

quality:
name: Code Quality & Package Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
- name: Set up Node.js environment (v${{ matrix.node-version }})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: 'npm'

- name: Display Node.js version
run: node -v
- name: Install Biome.js formatter and linter
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Install dependencies
- name: Install project dependencies
run: npm ci

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Run linting
run: npm run lint
- name: Verify code style and formatting (Biome)
run: |
npm run lint
npm run format
- name: Run type-checking
- name: Verify TypeScript types
run: npm run check-types

- name: Run tests
- name: Run unit and integration tests
run: npm test

- name: Build the package
- name: Build production package
run: npm run build
39 changes: 0 additions & 39 deletions .github/workflows/code-quality.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Release
name: NPM Package Release

on:
release:
types: [published]

jobs:
publish:
name: NPM Publish
name: Build & Publish to NPM Registry

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
node-version: [22.x]

permissions:
contents: read # Allow reading repository contents
Expand All @@ -21,20 +21,20 @@ jobs:
steps:
- uses: actions/checkout@v4 # Check out the repository code

- name: Setup Node.js ${{ matrix.node-version }}
- name: Set up Node.js environment (v${{ matrix.node-version }})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "npm"

- name: Install dependencies
- name: Install project dependencies
run: npm ci

- name: Build the project (if applicable)
- name: Build production package
run: npm run build --if-present

- name: Publish to npm
- name: Publish package to NPM Registry
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit d47565e

Please sign in to comment.