1313
1414# Define reusable job template
1515jobs :
16- # Shared setup job for dependency installation
17- setup :
16+ # Build and check
17+ build-and-check :
1818 runs-on : ubuntu-latest
1919 steps :
2020 - name : Checkout repository
3939 - name : Install dependencies
4040 run : bun install --frozen-lockfile
4141
42- - name : Upload node_modules
43- uses : actions/upload-artifact@v4
44- with :
45- name : node_modules
46- path : |
47- node_modules
48- */node_modules
49- packages/*/node_modules
50- retention-days : 1
51-
52- # Build and check
53- build-and-check :
54- needs : setup
55- runs-on : ubuntu-latest
56- steps :
57- - name : Checkout repository
58- uses : actions/checkout@v3
59-
60- - name : Set up Bun
61- uses : oven-sh/setup-bun@v2
62- with :
63- bun-version : ' 1.2.12'
64-
65- - name : Download node_modules
66- uses : actions/download-artifact@v4
67- with :
68- name : node_modules
69-
7042 - name : Set environment variables
7143 env :
7244 SECRETS_CONTEXT : ${{ toJSON(secrets) }}
8759 wait
8860 '
8961
62+ # - name: Build npm-app
63+ # run: cd npm-app && bun run build
64+
9065 # - name: Open interactive debug shell
9166 # if: ${{ failure() }}
9267 # uses: mxschmitt/action-tmate@v3
@@ -113,10 +88,19 @@ jobs:
11388 with :
11489 bun-version : ' 1.2.12'
11590
116- - name : Download node_modules
117- uses : actions/download-artifact@v4
91+ - name : Cache dependencies
92+ uses : actions/cache@v3
11893 with :
119- name : node_modules
94+ path : |
95+ node_modules
96+ */node_modules
97+ packages/*/node_modules
98+ key : ${{ runner.os }}-deps-${{ hashFiles('**/bun.lockb') }}
99+ restore-keys : |
100+ ${{ runner.os }}-deps-
101+
102+ - name : Install dependencies
103+ run : bun install --frozen-lockfile
120104
121105 - name : Set environment variables
122106 env :
@@ -164,10 +148,19 @@ jobs:
164148 with :
165149 bun-version : ' 1.2.12'
166150
167- - name : Download node_modules
168- uses : actions/download-artifact@v4
151+ - name : Cache dependencies
152+ uses : actions/cache@v3
169153 with :
170- name : node_modules
154+ path : |
155+ node_modules
156+ */node_modules
157+ packages/*/node_modules
158+ key : ${{ runner.os }}-deps-${{ hashFiles('**/bun.lockb') }}
159+ restore-keys : |
160+ ${{ runner.os }}-deps-
161+
162+ - name : Install dependencies
163+ run : bun install --frozen-lockfile
171164
172165 - name : Set environment variables
173166 env :
0 commit comments