Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

chore: update node version of the CI environment to 18 (#499)

白熱b849862d2651
diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml
index f95a8ef350..668ec0c5a7 100644
--- a/.github/workflows/ci-lint.yml
+++ b/.github/workflows/ci-lint.yml
@@ -24,7 +24,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
- node-version: 16
+ node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml
index a62d046a87..5ecfccc92a 100644
--- a/.github/workflows/ci-test.yml
+++ b/.github/workflows/ci-test.yml
@@ -14,6 +14,10 @@ jobs:
build:
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [16, 18]
+
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
@@ -25,7 +29,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
- node-version: 16
+ node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v2
diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml
index f779b8d803..73f56e2977 100644
--- a/.github/workflows/pr-title-lint.yml
+++ b/.github/workflows/pr-title-lint.yml
@@ -21,7 +21,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
- node-version: 16
+ node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
@@ -46,18 +46,3 @@ jobs:
run: pnpm install
- run: echo "${{ github.event.pull_request.title }}" | pnpx commitlint -g ./commitlint.config.cjs
-
- set-pr-id:
- name: Set PR ID
- runs-on: ubuntu-latest
- steps:
- - name: Save PR number
- if: ${{ always() }}
- run: echo ${{ github.event.pull_request.number }} > ./pr-id.txt
-
- - name: Upload PR number
- if: ${{ always() }}
- uses: actions/upload-artifact@v3
- with:
- name: pr
- path: ./pr-id.txt
diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml
new file mode 100644
index 0000000000..d02fe1289b
--- /dev/null
+++ b/.github/workflows/preview-build.yml
@@ -0,0 +1,86 @@
+name: 📦 Preview Build
+
+on:
+ push:
+ branches: [main, dev]
+ pull_request:
+ branches: [main, dev]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ if: github.repository == 'dream-num/univer'
+ runs-on: ubuntu-latest
+
+ env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ vars.TURBO_TEAM }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+ run_install: false
+
+ - name: Get pnpm store directory
+ shell: bash
+ run: |
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ env.STORE_PATH }}
+ key: ${{ runner.os }}-demo-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-demo-
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: 📦 Build
+ run: pnpm run build
+
+ - name: 📦 Build demo
+ run: pnpm run build:demo
+
+ - name: Copy demo to workspace
+ run: |
+ mkdir .workspace
+ cp -r ./examples/univer-doc-ts/local .workspace/doc
+ cp -r ./examples/univer-sheet-ts/local .workspace/sheet
+ cp -r ./examples/univer-slide-ts/local .workspace/slide
+
+ - name: Setup demo cache
+ uses: actions/cache@v3
+ with:
+ path: .workspace
+ key: ${{ runner.os }}-demo-${{ github.event.pull_request.number }}
+ restore-keys: |
+ ${{ runner.os }}-demo-
+
+ set-pr-id:
+ name: Set PR ID
+ runs-on: ubuntu-latest
+ steps:
+ - name: Save PR number
+ if: ${{ always() }}
+ run: echo ${{ github.event.pull_request.number }} > ./pr-id.txt
+
+ - name: Upload PR number
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: pr
+ path: ./pr-id.txt
diff --git a/.github/workflows/ci-preview.yml b/.github/workflows/preview-deploy.yml
similarity index 80%
rename from .github/workflows/ci-preview.yml
rename to .github/workflows/preview-deploy.yml
index c8acc7500d..05c921f84d 100644
--- a/.github/workflows/ci-preview.yml
+++ b/.github/workflows/preview-deploy.yml
@@ -1,8 +1,8 @@
-name: 📦 CI Preview
+name: 📤 Preview Deploy
on:
workflow_run:
- workflows: ['📌 PR Title Lint']
+ workflows: ['📦 Preview Build']
types:
- completed
@@ -15,47 +15,11 @@ jobs:
if: github.repository == 'dream-num/univer'
runs-on: ubuntu-latest
- env:
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- TURBO_TEAM: ${{ vars.TURBO_TEAM }}
-
steps:
- name: Checkout
uses: actions/checkout@v3
- - name: Install Node.js
- uses: actions/setup-node@v3
- with:
- node-version: 16
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 8
- run_install: false
-
- - name: Get pnpm store directory
- shell: bash
- run: |
- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
-
- - name: Setup pnpm cache
- uses: actions/cache@v3
- with:
- path: ${{ env.STORE_PATH }}
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-pnpm-store-
-
- - name: Install dependencies
- run: pnpm install
-
- - name: 📦 Build
- run: pnpm run build
-
- - name: 📦 Build demo
- run: pnpm run build:demo
-
+ # Get PR ID from artifact
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
@@ -67,6 +31,15 @@ jobs:
id: pr
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: .workspace
+ key: ${{ runner.os }}-demo-${{ steps.pr.outputs.id }}
+ restore-keys: |
+ ${{ runner.os }}-demo-
+
- name: 🚀 Deploy to Vercel (demo)
uses: amondnet/vercel-action@v25
id: vercel-demo