Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/setup-nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup Node.js Environment
description: Setup Node.js with caching and dependency installation
inputs:
working-directory:
description: The working directory of the application that will use this action
required: true

runs:
using: composite
steps:
# To automatically get bug fixes and new Node.js versions for actions/setup-node,
# change this to (see https://github.com/actions/setup-node#usage):
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
- name: Install pnpm
shell: bash
run: corepack enable && corepack prepare pnpm@latest --activate
- name: Install Node.js dependencies
shell: bash
working-directory: ${{ inputs.working-directory }}
run: pnpm install --frozen-lockfile
62 changes: 37 additions & 25 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,54 @@ on:
branches:
- master
paths:
- '.github/workflows/javascript.yml'
- '.node-version'
- 'javascript/package.json'
- 'javascript/pnpm-lock.yaml'
- 'javascript/**/*.js'
- .github/workflows/javascript.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
- javascript/pnpm-workspace.yaml
- javascript/**/*.js
pull_request:
paths:
- '.github/workflows/javascript.yml'
- '.node-version'
- 'javascript/package.json'
- 'javascript/pnpm-lock.yaml'
- 'javascript/**/*.js'
- .github/workflows/javascript.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
- javascript/pnpm-workspace.yaml
- javascript/**/*.js

permissions:
contents: read
pull-requests: read

jobs:
build:
timeout-minutes: 10
change-detection:
runs-on: ubuntu-latest
outputs:
javascript-changes: ${{ steps.change-detection.outputs.javascript }}
steps:
- uses: actions/checkout@v6
# https://github.com/actions/setup-node/
- name: Set up pnpm
uses: pnpm/action-setup@v5
- name: Change Detection
uses: dorny/paths-filter@v4
id: change-detection
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v4
filters: |
javascript:
- .github/workflows/javascript.yml
- .node-version
- javascript/package.json
- javascript/pnpm-lock.yaml
- javascript/pnpm-workspace.yaml
- javascript/**/*.js
jest:
timeout-minutes: 10
runs-on: ubuntu-latest
needs: change-detection
if: needs.change-detection.outputs.javascript-changes == 'true'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-nodejs
with:
node-version-file: '.node-version'
cache: 'pnpm'
cache-dependency-path: 'javascript/pnpm-lock.yaml'
- name: Install Packages
working-directory: ./javascript
run: pnpm install --frozen-lockfile
- name: Run Jest
working-directory: ./javascript
- name: Jest
working-directory: ./javascript
run: pnpm exec jest
2 changes: 1 addition & 1 deletion javascript/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages:
- .

allowBuilds:
unrs-resolver: set this to true or false
unrs-resolver: true

ignoredBuiltDependencies:
- core-js
Loading