Skip to content

Commit 437dab0

Browse files
chore: separate build step
1 parent 1b76de3 commit 437dab0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/build_publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
node-version: lts/*
2121
- name: Install dependencies
2222
run: npm install
23-
- name: Build package
24-
run: npm run build
23+
- name: Run tests
24+
run: npm run test-coverage:ci
2525
env:
2626
API_BASE_URL: ${{ vars.API_BASE_URL }}
2727
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
@@ -52,6 +52,14 @@ jobs:
5252
TEST_SURVEY_ID: ${{ vars.TEST_SURVEY_ID }}
5353
TEST_SURVEY_RECORD_ID: ${{ vars.TEST_SURVEY_RECORD_ID }}
5454
TEST_TEXT_FIELD: ${{ vars.TEST_TEXT_FIELD }}
55+
- name: Cleanup
56+
run: npm run cleanup
57+
- name: Build ESM
58+
run: npm run build:esm
59+
- name: Build CJS
60+
run: npm run build:cjs
61+
- name: Build package.json
62+
run: npm run build:json
5563
- name: Upload coverage reports to Codecov
5664
uses: codecov/codecov-action@v3
5765
with:

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
"format-staged": "pretty-quick --staged",
5151
"format": "pretty-quick",
5252
"build": "npm run test-coverage:ci && npm run clean && tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json && node ./scripts/create_dist_package_json.js",
53+
"build:esm": "tsc --project tsconfig.esm.json",
54+
"build:cjs": "tsc --project tsconfig.cjs.json",
55+
"build:json": "node ./scripts/create_dist_package_json.js",
5356
"test:unit": "mocha -r ts-node/register",
5457
"test:integration": "mocha -r ts-node/register -r integrationTests/mochaRootHooks.ts",
5558
"tests:unit": "mocha -R progress -r ts-node/register ./tests/**/*.spec.ts",

0 commit comments

Comments
 (0)