Skip to content
Open
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: 15 additions & 8 deletions .github/actions/setup-node-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,40 @@ outputs:
runs:
using: 'composite'
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '10'
run_install: false

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

- name: Get NPM cache directory
- name: Get PNPM store directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
run: echo "dir=$(pnpm store path)" >> ${GITHUB_OUTPUT}

- name: Restore NPM cache
- name: Restore PNPM store
id: restore-cache
uses: actions/cache/restore@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: npm-main-${{ inputs.platform }}-${{ hashFiles('./package-lock.json') }}
key: pnpm-main-${{ inputs.platform }}-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: |
npm-main-${{ inputs.platform }}-
pnpm-main-${{ inputs.platform }}-

- name: Download dependencies
shell: bash
run: |
npm ci --ignore-scripts --verbose || npm ci --ignore-scripts --verbose || npm ci --ignore-scripts --verbose
pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about this, but it seems reasonable to hope that pnpm will be more stable and not require this "retry 3 times" hack.


- name: Save NPM cache
- name: Save PNPM store
if: inputs.save-cache == 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: npm-main-${{ inputs.platform }}-${{ hashFiles('./package-lock.json') }}
key: pnpm-main-${{ inputs.platform }}-${{ hashFiles('./pnpm-lock.yaml') }}
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
working-directory: ${{ runner.temp }}

- name: Compile code
run: npm run build -- --ignore @temporalio/core-bridge
run: pnpm run build --ignore @temporalio/core-bridge

- name: Publish to Verdaccio
run: node scripts/publish-to-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry
Expand All @@ -196,7 +196,7 @@ jobs:
--headless &> ./devserver.log &

- name: Run Tests
run: npm run test
run: pnpm run test
env:
RUN_INTEGRATION_TESTS: true
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}
Expand Down Expand Up @@ -260,6 +260,7 @@ jobs:

# End samples

# TODO: PNPM doesn't write logs to file by default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't mind just removing that step.

- name: Upload NPM logs
uses: actions/upload-artifact@v4
if: failure() || cancelled()
Expand All @@ -282,7 +283,7 @@ jobs:
# FIXME: Update this job to reuse native build artifacts from compile-native-binaries
features-tests:
name: Features Tests
uses: temporalio/features/.github/workflows/typescript.yaml@main
uses: temporalio/features/.github/workflows/typescript.yaml@olszewski/pnpm
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used to verify CI setup. Once both PRs are approved will switch to main before landing

with:
typescript-repo-path: ${{github.event.pull_request.head.repo.full_name}}
version: ${{github.event.pull_request.head.ref}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conventions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# eslint-import-resolver-typescript requires packages to be built
- name: Compile all non-rust code
run: npm run build -- --ignore @temporalio/core-bridge
run: pnpm run build --ignore @temporalio/core-bridge

- run: npm run lint.check
- run: npm run lint.prune
- run: pnpm run lint.check
- run: pnpm run lint.prune
26 changes: 19 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,32 @@ jobs:
node-version: '22'
platform: 'linux-x64'

- run: npm run build -- --ignore @temporalio/core-bridge
- run: pnpm run build --ignore @temporalio/core-bridge

- name: Build docs
run: npm run docs
run: pnpm run docs
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}

- name: Publish docs
if: ${{ inputs.publish_target }}
- name: Publish production docs
if: ${{ inputs.publish_target == 'prod' }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
npx vercel deploy packages/docs/build \
-t '${{ secrets.VERCEL_TOKEN }}' \
pnpm dlx vercel deploy packages/docs/build \
-t "$VERCEL_TOKEN" \
--yes \
${{ inputs.publish_target == 'prod' && '--prod' || '' }}
--prod

- name: Publish preview docs
if: ${{ inputs.publish_target && inputs.publish_target != 'prod' }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: |
pnpm dlx vercel deploy packages/docs/build \
-t "$VERCEL_TOKEN" \
--yes
8 changes: 1 addition & 7 deletions .github/workflows/nightly-throughput-stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
with:
node-version: '22'
platform: 'linux-x64'
save-cache: 'true'

- name: Install protoc
uses: arduino/setup-protoc@v3
Expand All @@ -101,13 +102,6 @@ jobs:
env:
BUILD_CORE_RELEASE: true

- name: Save NPM cache
uses: actions/cache/save@v4
if: always()
with:
path: ${{ steps.setup-node.outputs.cache-dir }}
key: npm-main-linux-x64-${{ hashFiles('./package-lock.json') }}

- name: Install Temporal CLI
uses: temporalio/setup-temporal@v0

Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ jobs:
with:
node-version: '22'
platform: ${{ matrix.platform }}
save-cache: ${{ env.IS_MAIN_OR_RELEASE }}

- name: Compile code
run: npm run build -- --ignore @temporalio/core-bridge
run: pnpm run build --ignore @temporalio/core-bridge

- name: Publish to Verdaccio
run: node scripts/publish-to-verdaccio.js --registry-dir ./tmp/registry
Expand All @@ -188,14 +189,6 @@ jobs:
name: verdaccio-repo
path: ./tmp/registry/storage

- name: Save NPM cache
uses: actions/cache/save@v4
# Only saves NPM cache from the main branch, to reduce pressure on the cache (limited to 10GB).
if: ${{ env.IS_MAIN_OR_RELEASE == 'true' }}
with:
path: ${{ steps.setup-node.outputs.cache-dir }}
key: npm-main-${{ matrix.platform }}-${{ hashFiles('./package-lock.json') }}

# Tests that npm init @temporalio results in a working worker and client
test-npm-init:
needs: build-packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
save-if: ${{ env.IS_MAIN_OR_RELEASE == 'true' }}

- name: Compile code
run: npm run build
run: pnpm run build
env:
BUILD_CORE_RELEASE: true

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ packages/*/CHANGELOG.md
packages/docs/docs/api
typedoc-sidebar.js
lerna.json
pnpm-lock.yaml
README.md
packages/proto/protos/root.d.ts
packages/proto/protos/json-module.js
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": "1.13.2",
"npmClient": "npm",
"npmClient": "pnpm",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect the diff to show the previous line being deleted. Could it be that you duplicated the line rather than modify it?

"command": {
"publish": {
"message": "chore(release): Publish",
Expand All @@ -11,4 +12,4 @@
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
}
Loading
Loading