Skip to content

Commit ad50336

Browse files
committed
ci(workspaces): configured modified workspaces building on PR
1 parent bf062dc commit ad50336

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ jobs:
2222
CI_JOB_NUMBER: 2
2323
steps:
2424
- uses: actions/checkout@v1
25+
with:
26+
fetch-depth: 0
2527
- name: Use Node.js from .nvmrc
2628
uses: actions/setup-node@v6
2729
with:
2830
node-version-file: '.nvmrc'
2931
- run: corepack enable
3032
- run: yarn install
31-
- run: yarn build
33+
- run: yarn build:modified origin/${{ github.event.pull_request.base.ref }}

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- run: corepack enable
1818
- run: yarn
1919
- run: yarn lint-test
20-
- run: yarn build
20+
- run: yarn build:all
2121
- run: yarn workspace @hawk.so/javascript publish --access=public
2222
env:
2323
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
],
1010
"scripts": {
1111
"dev": "yarn workspace @hawk.so/javascript dev",
12-
"build": "yarn workspace @hawk.so/javascript build",
12+
"build:all": "yarn workspaces foreach -Apt run build",
13+
"build:modified": "yarn workspaces foreach --since=\"$@\" -Rpt run build",
1314
"stats": "yarn workspace @hawk.so/javascript stats",
1415
"lint": "eslint -c ./.eslintrc.cjs packages/*/src --ext .ts,.js --fix",
1516
"lint-test": "eslint -c ./.eslintrc.cjs packages/*/src --ext .ts,.js"

0 commit comments

Comments
 (0)