11
11
branches :
12
12
- ' **'
13
13
jobs :
14
- # build:
15
- # runs-on: ubuntu-latest
16
- # name: Build the package
17
- # steps:
18
- # - uses: actions/checkout@v4
19
- # - uses: pnpm/action-setup@v3
20
- # - uses: actions/setup-node@v4
21
- # with:
22
- # node-version: 22
23
- # cache: 'pnpm'
24
- # - run: pnpm install
25
- # env:
26
- # CYPRESS_INSTALL_BINARY: 0
27
- # CHROMEDRIVER_SKIP_DOWNLOAD: true
28
- # - run: pnpm build
29
- # - run: pnpm test:unit
30
-
31
- # - run: pnpm snapshot
32
- # # Use cache to share the output across different jobs
33
- # # No need to cache node_modules because they are all bundled
34
- # - uses: actions/cache/save@v4
35
- # id: cache
36
- # with:
37
- # path: |
38
- # outfile.cjs
39
- # playground
40
- # key: ${{ github.sha }}-${{ hashFiles('pnpm-lock.yaml') }}
14
+ build :
15
+ runs-on : ubuntu-latest
16
+ name : Build the package
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+ with :
20
+ submodules : true
21
+ - uses : pnpm/action-setup@v4
22
+ - uses : actions/setup-node@v4
23
+ with :
24
+ node-version : 22
25
+ cache : ' pnpm'
26
+ - run : pnpm install
27
+ env :
28
+ CYPRESS_INSTALL_BINARY : 0
29
+ CHROMEDRIVER_SKIP_DOWNLOAD : true
30
+ - run : pnpm build
31
+ - run : pnpm test:unit
32
+
33
+ - run : pnpm snapshot
34
+
35
+ # Use artifact to share the output across different jobs
36
+ # No need to save node_modules because they are all bundled
37
+ - uses : actions/upload-artifact@v2
38
+ with :
39
+ name : build-output
40
+ path : |
41
+ outfile.cjs
42
+ playground
43
+ retention-days : 3
41
44
42
45
test-build :
43
- # needs: build
46
+ needs : build
44
47
strategy :
45
48
matrix :
46
49
node-version : [22]
47
- os : [ubuntu-latest]
50
+ os : [ubuntu-latest, windows-latest, macos-latest ]
48
51
runs-on : ${{ matrix.os }}
49
52
continue-on-error : ${{ matrix.os == 'windows-latest' }}
50
53
env :
@@ -54,33 +57,27 @@ jobs:
54
57
- uses : actions/checkout@v4
55
58
with :
56
59
submodules : true
57
- - uses : pnpm/action-setup@v3
58
- with :
59
- standalone : true
60
+ - uses : pnpm/action-setup@v4
60
61
- uses : actions/setup-node@v4
61
62
with :
62
63
node-version : ${{ matrix.node-version }}
63
64
cache : ' pnpm'
64
65
65
- # - uses: actions/cache/restore@v4
66
- # id: cache-restore
67
- # with:
68
- # path: |
69
- # outfile.cjs
70
- # playground
71
- # key: ${{ github.sha }}-${{ hashFiles('pnpm-lock.yaml') }}
72
- - name : Build the package
73
- run : pnpm install && pnpm build && pnpm snapshot
74
- - run : echo "{}" > playground/package.json
75
- - run : mv playground playground-tmp
66
+ # use artifacts to share the playground across different jobs
67
+ - uses : actions/download-artifact@v2
68
+ with :
69
+ name : build-output
70
+
76
71
- name : Install dependencies in playground
77
- run : pnpm -C ./playground-tmp install --no-frozen-lockfile
72
+ working-directory : ./playground
73
+ run : pnpm install --no-frozen-lockfile
78
74
79
75
- name : Run build script in playground
80
- run : pnpm -C ./playground-tmp --filter "*" build
76
+ working-directory : ./playground
77
+ run : pnpm --filter "*" build
81
78
82
79
# test-vitest:
83
- # needs: build
80
+ # # needs: build
84
81
# strategy:
85
82
# matrix:
86
83
# node-version: [22]
@@ -92,25 +89,21 @@ jobs:
92
89
# CHROMEDRIVER_SKIP_DOWNLOAD: true
93
90
# steps:
94
91
# - uses: actions/checkout@v4
95
- # - uses: pnpm/action-setup@v3
92
+ # with:
93
+ # submodules: true
94
+ # - uses: pnpm/action-setup@v4
96
95
# - uses: actions/setup-node@v4
97
96
# with:
98
97
# node-version: ${{ matrix.node-version }}
99
98
# cache: 'pnpm'
100
99
101
- # - uses: actions/cache/restore@v4
102
- # id: cache-restore
103
- # with:
104
- # path: outfile.cjs
105
- # key: ${{ github.sha }}-${{ hashFiles('pnpm-lock.yaml') }}
106
- # - name: Build the package on cache miss
107
- # if: steps.cache-restore.outputs.cache-hit != 'true'
108
- # run: pnpm install && pnpm build
109
- # - name: Snapshot
110
- # run: pnpm snapshot && echo "{}" > playground/package.json && mv playground ../playground
100
+ # # FIXME: use artifacts to share the playground across different jobs
101
+ # - name: Build the package
102
+ # run: pnpm install && pnpm build && pnpm snapshot
111
103
# - name: Install dependencies in playground
112
- # working-directory: .. /playground
104
+ # working-directory: ./playground
113
105
# run: pnpm install --no-frozen-lockfile
106
+
114
107
# - name: Run test:unit script in vitest projects
115
108
# working-directory: ../playground
116
109
# run: pnpm --filter "{*vitest*}" test:unit
0 commit comments