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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
ci: improve workflow caching
白熱7a31b6198dab
diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.ymlindex cfccf7d194..5f7e2d09ff 100644--- a/.github/actions/setup-node/action.yml+++ b/.github/actions/setup-node/action.yml@@ -1,6 +1,11 @@name: Node Setupdescription: Node.js setup for CI, including cache configuration+inputs:+ save-cache:+ description: Save a new pnpm store cache entry from this job+ default: 'false'+runs:using: compositesteps:@@ -13,8 +18,28 @@ runs:uses: actions/setup-node@v6with:node-version: 24.3.0- cache: pnpm++ - name: Get pnpm store path+ id: pnpm-store+ shell: bash+ run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"++ - name: Restore pnpm store+ id: pnpm-cache+ uses: actions/cache/restore@v6+ with:+ path: ${{ steps.pnpm-store.outputs.path }}+ key: pnpm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml') }}+ restore-keys: |+ pnpm-${{ runner.os }}-${{ runner.arch }}-- name: Install dependencies- run: pnpm install+ run: pnpm install --frozen-lockfileshell: bash++ - name: Save pnpm store+ if: inputs.save-cache == 'true' && github.ref_name == github.event.repository.default_branch && steps.pnpm-cache.outputs.cache-hit != 'true'+ uses: actions/cache/save@v6+ with:+ path: ${{ steps.pnpm-store.outputs.path }}+ key: pnpm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml') }}diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.ymlindex 35aab9feb7..b845de1d87 100644--- a/.github/workflows/build-packages.yml+++ b/.github/workflows/build-packages.yml@@ -27,6 +27,7 @@ jobs:build:if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)runs-on: ubuntu-latest+ timeout-minutes: 15env:TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}@@ -42,6 +43,8 @@ jobs:- name: Setup Node.jsuses: ./.github/actions/setup-node+ with:+ save-cache: 'true'- name: 📦 Buildrun: pnpm build:cidiff --git a/.github/workflows/ci-quality-checks.yml b/.github/workflows/ci-quality-checks.ymlindex b2f3cda3f1..221c02af6f 100644--- a/.github/workflows/ci-quality-checks.yml+++ b/.github/workflows/ci-quality-checks.yml@@ -29,8 +29,8 @@ jobs:name: test shard (${{ matrix.shard-index }}/${{ matrix.shard-total }})if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)runs-on: ubuntu-latest+ timeout-minutes: 15strategy:- fail-fast: falsematrix:shard-index: [1, 2, 3, 4]shard-total: [4]@@ -60,7 +60,8 @@ jobs:test:name: testif: always() && github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)- runs-on: ubuntu-latest+ runs-on: minimum-runner+ timeout-minutes: 5needs: test-shardsteps:@@ -76,6 +77,7 @@ jobs:eslint:if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)runs-on: ubuntu-latest+ timeout-minutes: 10steps:- name: Checkout@@ -87,7 +89,8 @@ jobs:uses: ./.github/actions/setup-node- name: Restore ESLint cache- uses: actions/cache@v6+ id: eslint-cache+ uses: actions/cache/restore@v6with:path: .eslintcachekey: eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-${{ github.sha }}@@ -97,9 +100,17 @@ jobs:- name: 🌡️ Run ESLintrun: pnpm lint --quiet --cache --cache-location .eslintcache+ - name: Save ESLint cache+ if: github.ref_name == github.event.repository.default_branch && steps.eslint-cache.outputs.cache-hit != 'true'+ uses: actions/cache/save@v6+ with:+ path: .eslintcache+ key: eslint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'eslint.config.ts') }}-${{ github.sha }}+typecheck:if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)runs-on: ubuntu-latest+ timeout-minutes: 10env:TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}TURBO_TEAM: ${{ vars.TURBO_TEAM }}diff --git a/.github/workflows/dev-performance-log.yml b/.github/workflows/dev-performance-log.ymlindex ebc9d91a83..997b828ae4 100644--- a/.github/workflows/dev-performance-log.yml+++ b/.github/workflows/dev-performance-log.yml@@ -16,6 +16,7 @@ jobs:e2e-test:if: github.repository == 'dream-num/univer'runs-on: ubuntu-latest+ timeout-minutes: 20env:GH_TOKEN: ${{ github.token }}diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlindex aa32968dd9..59bd005c20 100644--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@ -17,7 +17,6 @@ concurrency:permissions:contents: readpull-requests: write- actions: writeenv:TURBO_TELEMETRY_DISABLED: '1'@@ -27,9 +26,9 @@ jobs:name: e2e-test shard (${{ matrix.shard-index }}/${{ matrix.shard-total }})if: github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft)runs-on: ubuntu-latest+ timeout-minutes: 15strategy:- fail-fast: falsematrix:shard-index: [1, 2, 3, 4]shard-total: [4]@@ -47,7 +46,8 @@ jobs:uses: ./.github/actions/setup-node- name: Cache Playwright browsers- uses: actions/cache@v6+ id: playwright-cache+ uses: actions/cache/restore@v6with:path: ~/.cache/ms-playwrightkey: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}@@ -55,6 +55,13 @@ jobs:- name: Install Playwright Browsersrun: pnpm exec playwright install --with-deps chromium+ - name: Save Playwright browsers+ if: matrix.shard-index == 1 && steps.playwright-cache.outputs.cache-hit != 'true'+ uses: actions/cache/save@v6+ with:+ path: ~/.cache/ms-playwright+ key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}+- name: Build E2E Clientrun: pnpm build:e2e@@ -74,7 +81,7 @@ jobs:with:name: playwright-report-${{ matrix.shard-index }}-of-${{ matrix.shard-total }}path: playwright-report/- retention-days: 30+ retention-days: 7- name: Upload HeapSnapshotsuses: actions/upload-artifact@v7@@ -86,7 +93,8 @@ jobs:e2e-test:name: e2e-test- runs-on: ubuntu-latest+ runs-on: minimum-runner+ timeout-minutes: 5needs: e2e-shardif: ${{ always() && github.repository == 'dream-num/univer' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }}diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.ymlindex 7678931b26..5452093f25 100644--- a/.github/workflows/release-npm.yml+++ b/.github/workflows/release-npm.yml@@ -19,30 +19,10 @@ env:TURBO_TELEMETRY_DISABLED: '1'jobs:- prepare:- if: github.repository == 'dream-num/univer'- runs-on: ubuntu-latest-- outputs:- release_type: ${{ steps.release-type.outputs.value }}-- steps:- - name: 🚚 Get release type- id: release-type- env:- REF_NAME: ${{ github.ref_name }}- run: |- if [[ "$REF_NAME" =~ -(alpha|beta|rc)\. ]]; then- extracted_type="${BASH_REMATCH[1]}"- echo "value=$extracted_type" >> "$GITHUB_OUTPUT"- else- echo "value=stable" >> "$GITHUB_OUTPUT"- fi-release-npm:- needs: [prepare]if: github.repository == 'dream-num/univer'runs-on: ubuntu-latest+ timeout-minutes: 30permissions:contents: readid-token: write@@ -67,17 +47,17 @@ jobs:- name: 🚚 Install dependencies and buildrun: |- pnpm install+ pnpm install --frozen-lockfilepnpm build- name: 🐙 Publishenv:NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}NPM_CONFIG_PROVENANCE: true- RELEASE_TYPE: ${{ needs.prepare.outputs.release_type }}+ REF_NAME: ${{ github.ref_name }}run: |- if [[ "$RELEASE_TYPE" == "stable" ]]; then- pnpm publish --access public -r --no-git-checks+ if [[ "$REF_NAME" =~ -(alpha|beta|rc)\. ]]; then+ pnpm publish --access public --tag "${BASH_REMATCH[1]}" -r --no-git-checkselse- pnpm publish --access public --tag "$RELEASE_TYPE" -r --no-git-checks+ pnpm publish --access public -r --no-git-checksfidiff --git a/.github/workflows/update-playwright-snapshots.yml b/.github/workflows/update-playwright-snapshots.ymlindex 10dea9e92f..7a03234834 100644--- a/.github/workflows/update-playwright-snapshots.yml+++ b/.github/workflows/update-playwright-snapshots.yml@@ -11,6 +11,7 @@ jobs:update-snapshots:if: github.repository == 'dream-num/univer'runs-on: ubuntu-latest+ timeout-minutes: 30env:GH_TOKEN: ${{ github.token }}