Skip to content

Commit 45c5df1

Browse files
committed
run typecheck and web build in parallel in terminal, not ci directly
1 parent 7c98754 commit 45c5df1

File tree

1 file changed

+10
-62
lines changed

1 file changed

+10
-62
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
packages/*/node_modules
5050
retention-days: 1
5151

52-
# Build web in parallel
53-
build-web:
52+
# Build and check
53+
build-and-check:
5454
needs: setup
5555
runs-on: ubuntu-latest
5656
steps:
@@ -79,65 +79,13 @@ jobs:
7979
echo "NEXT_PUBLIC_CB_ENVIRONMENT=test" >> $GITHUB_ENV
8080
echo "CODEBUFF_GITHUB_TOKEN=${{ secrets.CODEBUFF_GITHUB_TOKEN }}" >> $GITHUB_ENV
8181
82-
- name: Build web
82+
- name: Typecheck and Build web in parallel
8383
run: |
84-
cd web && bun run build
85-
86-
# Typecheck in parallel
87-
typecheck:
88-
needs: setup
89-
runs-on: ubuntu-latest
90-
steps:
91-
- name: Checkout repository
92-
uses: actions/checkout@v3
93-
94-
- name: Set up Bun
95-
uses: oven-sh/setup-bun@v2
96-
with:
97-
bun-version: '1.2.12'
98-
99-
- name: Download node_modules
100-
uses: actions/download-artifact@v4
101-
with:
102-
name: node_modules
103-
104-
- name: Set environment variables
105-
env:
106-
SECRETS_CONTEXT: ${{ toJSON(secrets) }}
107-
run: |
108-
VAR_NAMES=$(node scripts/generate-ci-env.js)
109-
echo "$SECRETS_CONTEXT" | jq -r --argjson vars "$VAR_NAMES" '
110-
to_entries | .[] | select(.key as $k | $vars | index($k)) | .key + "=" + .value
111-
' >> $GITHUB_ENV
112-
echo "CODEBUFF_GITHUB_ACTIONS=true" >> $GITHUB_ENV
113-
echo "NEXT_PUBLIC_CB_ENVIRONMENT=test" >> $GITHUB_ENV
114-
echo "CODEBUFF_GITHUB_TOKEN=${{ secrets.CODEBUFF_GITHUB_TOKEN }}" >> $GITHUB_ENV
115-
116-
- name: Typecheck
117-
run: |
118-
bun run typecheck
119-
120-
# Build npm-app in parallel
121-
build:
122-
needs: setup
123-
runs-on: ubuntu-latest
124-
steps:
125-
- name: Checkout repository
126-
uses: actions/checkout@v3
127-
128-
- name: Set up Bun
129-
uses: oven-sh/setup-bun@v2
130-
with:
131-
bun-version: '1.2.12'
132-
133-
- name: Download node_modules
134-
uses: actions/download-artifact@v4
135-
with:
136-
name: node_modules
137-
138-
- name: Build
139-
run: |
140-
cd npm-app && bun run build
84+
timeout 10m bash -c '
85+
bun run typecheck &
86+
cd web && bun run build &
87+
wait
88+
'
14189
14290
# - name: Open interactive debug shell
14391
# if: ${{ failure() }}
@@ -146,7 +94,7 @@ jobs:
14694

14795
# Template for test jobs
14896
test:
149-
needs: [build-web, typecheck, build]
97+
needs: [build-and-check]
15098
strategy:
15199
matrix:
152100
package: [npm-app, backend, common]
@@ -197,7 +145,7 @@ jobs:
197145

198146
# Integration tests job
199147
test-integration:
200-
needs: [build-web, typecheck, build]
148+
needs: [build-and-check]
201149
strategy:
202150
matrix:
203151
package: [npm-app, backend, common]

0 commit comments

Comments
 (0)