-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add prettier and eslint checks in actions and fix nodejs actions (#…
…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
Showing
3 changed files
with
78 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |