Skip to content

Commit

Permalink
ci: add prettier and eslint checks in actions and fix nodejs actions (#…
Browse files Browse the repository at this point in the history
…551)

* build: add prettier and eslint checks in actions

* chore: remove branch restriction for NodeJS checks

* build: add documentation build and upload steps for Node.js 20.x

* fix: update condition syntax for Node.js 20.x in workflow

* fix: update condition syntax for Node.js version check in workflow

* fix: update documentation build and upload steps for Node.js 20.x workflow

* fix: update Node.js version check for documentation build and add GitHub Pages deployment step

* fix: update job name in Node.js workflow to include documentation build

* fix: enable pull request trigger for Node.js workflow

* fix: update Node.js version matrix and documentation build conditions

* fix: update Node.js setup action to v4 and adjust documentation comment
  • Loading branch information
bengeois authored Nov 2, 2024
1 parent 9d78f98 commit 51e3f81
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 78 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/merge-conflict-autolabel.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/node.js.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: NodeJS Checks

on:
push:
branches: [develop]
pull_request:

jobs:
build:
name: Build, Lint, Format, Tests and Build Docs
runs-on: ubuntu-latest

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

steps:
# Checkout the repository
- uses: actions/checkout@v4

# Setup Node.js environment
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

# Install dependencies
- name: Install dependencies
run: yarn install --immutable

# Run eslint
- name: Run ESLint
run: yarn lint

# Run prettier check
- name: Run Prettier
run: yarn format

# Run build
- name: Build project
run: yarn build

# Run tests
- name: Run tests
run: yarn test

# Build documentation only for Node.js 22.x
- name: Build documentation
if: matrix.node-version == '22.x'
run: yarn build:docs

# Upload documentation artifact (only for Node.js 22.x)
- name: Upload docs
if: matrix.node-version == '22.x'
uses: actions/upload-pages-artifact@v3
with:
path: "docs"

docs:
name: Deploy Docs
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
# Deploy documentation to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 51e3f81

Please sign in to comment.