mirror of
https://github.com/langgenius/dify.git
synced 2024-11-15 19:22:36 +08:00
Merge d0bbef77bd
into 2fed55ae6b
This commit is contained in:
commit
0d089740e1
26
.github/actions/setup-yarn/action.yml
vendored
Normal file
26
.github/actions/setup-yarn/action.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
name: Setup Yarn and NodeJS
|
||||
|
||||
inputs:
|
||||
node-version:
|
||||
description: NodeJS version to use and the Yarn installed with
|
||||
required: true
|
||||
default: 20
|
||||
yarn-lockfile:
|
||||
description: Path to the Yarn lockfile to restore cache from
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Set up Python ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: yarn
|
||||
cache-dependency-path: ${{ inputs.yarn-lockfile }}
|
||||
|
||||
- name: Install Yarn packages
|
||||
shell: bash
|
||||
run: |
|
||||
cd "$(dirname "${{ inputs.yarn-lockfile }}")"
|
||||
yarn install --frozen-lockfile
|
16
.github/workflows/style.yml
vendored
16
.github/workflows/style.yml
vendored
|
@ -63,19 +63,15 @@ jobs:
|
|||
id: changed-files
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: web/**
|
||||
files: |
|
||||
web/**
|
||||
.github/workflows/style.yml
|
||||
|
||||
- name: Setup NodeJS
|
||||
uses: actions/setup-node@v4
|
||||
- name: Setup NodeJS and Install Yarn dependencies
|
||||
uses: .github/actions/setup-yarn
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
with:
|
||||
node-version: 20
|
||||
cache: yarn
|
||||
cache-dependency-path: ./web/package.json
|
||||
|
||||
- name: Web dependencies
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: yarn install --frozen-lockfile
|
||||
yarn-lockfile: web/yarn.lock
|
||||
|
||||
- name: Web style check
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
|
|
11
.github/workflows/tool-test-sdks.yaml
vendored
11
.github/workflows/tool-test-sdks.yaml
vendored
|
@ -6,6 +6,7 @@ on:
|
|||
- main
|
||||
paths:
|
||||
- sdks/**
|
||||
- .github/workflows/tool-test-sdks.yaml
|
||||
|
||||
concurrency:
|
||||
group: sdk-tests-${{ github.head_ref || github.run_id }}
|
||||
|
@ -27,15 +28,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
- name: Setup NodeJS ${{ matrix.node-version }} and Install Yarn dependencies
|
||||
uses: .github/actions/setup-yarn
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: ''
|
||||
cache-dependency-path: 'yarn.lock'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
yarn-lockfile: sdks/nodejs-client/yarn.lock
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
|
|
@ -30,15 +30,12 @@ jobs:
|
|||
echo "FILES_CHANGED=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Set up Node.js
|
||||
- name: Setup NodeJS and Install Yarn dependencies
|
||||
uses: .github/actions/setup-yarn
|
||||
if: env.FILES_CHANGED == 'true'
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
yarn-lockfile: web/yarn.lock
|
||||
|
||||
- name: Install dependencies
|
||||
if: env.FILES_CHANGED == 'true'
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Run npm script
|
||||
if: env.FILES_CHANGED == 'true'
|
||||
|
|
17
.github/workflows/web-tests.yml
vendored
17
.github/workflows/web-tests.yml
vendored
|
@ -6,6 +6,7 @@ on:
|
|||
- main
|
||||
paths:
|
||||
- web/**
|
||||
- .github/workflows/web-tests.yml
|
||||
|
||||
concurrency:
|
||||
group: web-tests-${{ github.head_ref || github.run_id }}
|
||||
|
@ -27,19 +28,15 @@ jobs:
|
|||
id: changed-files
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: web/**
|
||||
files: |
|
||||
web/**
|
||||
.github/workflows/web-tests.yml
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
- name: Setup NodeJS and Install Yarn dependencies
|
||||
uses: .github/actions/setup-yarn
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
with:
|
||||
node-version: 20
|
||||
cache: yarn
|
||||
cache-dependency-path: ./web/package.json
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: yarn install --frozen-lockfile
|
||||
yarn-lockfile: web/yarn.lock
|
||||
|
||||
- name: Run tests
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
|
|
|
@ -23,3 +23,4 @@ TODO move to another place
|
|||
## Node.js
|
||||
|
||||
TODO move to another place
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@ If you are not familiar with writing tests, here is some code to refer to:
|
|||
|
||||
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Visit <https://docs.dify.ai/getting-started/readme> to view the full documentation.
|
||||
|
|
Loading…
Reference in New Issue
Block a user