Skip to content

Commit

Permalink
chore: automated tests for bundled core in apex-node and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiCanizales committed May 15, 2024
1 parent 63f120d commit 39b81b8
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 30 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Bundle
on:
workflow_call:
inputs:
branch:
description: 'Set the branch to bundle core'
required: false
type: string
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Install esbuild Dependencies
run: |
yarn add -D esbuild@^0.19.5 esbuild-plugin-pino@^2.1.0 npm-dts@^1.3.12 esbuild-plugin-tsc@^0.4.0
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Update for Bundling
run: |
node scripts/updateForBundling.js
- name: Generate Bundle
run: |
yarn build
node scripts/build.js
- name: Post Bundling Update
run: |
node scripts/postBundlingUpdate.js
43 changes: 13 additions & 30 deletions .github/workflows/esbuild-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,18 @@ on:
required: false

jobs:
build:
bundle:
uses: ./.github/workflows/bundle.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}
nodeVersion: ${{ inputs.nodeVersion }}
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Install esbuild Dependencies
run: |
yarn add -D esbuild@^0.19.5 esbuild-plugin-pino@^2.1.0 npm-dts@^1.3.12 esbuild-plugin-tsc@^0.4.0
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Update for Bundling
run: |
node scripts/updateForBundling.js
- name: Generate Bundle
run: |
yarn build
node scripts/build.js
- name: Post Bundling Update
run: |
node scripts/postBundlingUpdate.js
- name: Publish a Package
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish a Package
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/testCoreBundling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Core Bundling
on:
push:
branches-ignore: [main]
workflow_dispatch:
inputs:
branch:
description: 'Set the branch to bundle core'
required: false
type: string
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false

jobs:
bundle:
uses: ./.github/workflows/bundle.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}
nodeVersion: ${{ inputs.nodeVersion }}
xNuts:
needs: bundle
uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
secrets: inherit
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest']
externalProjectGitUrl:
- https://github.com/forcedotcom/salesforcedx-templates
- https://github.com/forcedotcom/salesforcedx-apex
with:
packageName: '@salesforce/core'
externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }}
command: 'yarn test'
os: ${{ matrix.os }}
useCache: false
preSwapCommands: 'yarn upgrade @jsforce/jsforce-node@latest; npx yarn-deduplicate; yarn install'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/core/node_modules/@jsforce/jsforce-node shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@salesforce/core node_modules/@salesforce/cli-plugins-testkit/node_modules/@salesforce/core node_modules/@salesforce/source-tracking/node_modules/@salesforce/core node_modules/@salesforce/source-deploy-retrieve/node_modules/@salesforce/core node_modules/@salesforce/apex-node/node_modules/@salesforce/core'

1 comment on commit 39b81b8

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

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

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 39b81b8 Previous: 0ea16f0 Ratio
Child logger creation 458773 ops/sec (±1.27%) 468974 ops/sec (±1.89%) 1.02
Logging a string on root logger 811115 ops/sec (±7.13%) 835988 ops/sec (±8.28%) 1.03
Logging an object on root logger 626839 ops/sec (±7.01%) 587131 ops/sec (±6.00%) 0.94
Logging an object with a message on root logger 8112 ops/sec (±207.82%) 3196 ops/sec (±228.93%) 0.39
Logging an object with a redacted prop on root logger 522398 ops/sec (±8.71%) 420142 ops/sec (±11.68%) 0.80
Logging a nested 3-level object on root logger 391256 ops/sec (±6.56%) 379549 ops/sec (±5.83%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.