@@ -66,14 +66,46 @@ jobs:
66
66
working-directory : ./sample
67
67
run : yarn build
68
68
69
+ bundle_with_nextjs :
70
+ needs : build
71
+ name : Test bundling with Next.js (webpack)
72
+ runs-on : ubuntu-latest
73
+ steps :
74
+ - name : Install Node.js
75
+ uses : actions/setup-node@v3
76
+ with :
77
+ node-version : 18
78
+ - name : Create a Next.js project
79
+ run : yarn create next-app sample --ts --eslint --tailwind --src-dir --app --import-alias="@/*"
80
+ - name : Download package
81
+ uses : actions/download-artifact@v3
82
+ with :
83
+ name : package.tgz
84
+ - name : Add package
85
+ working-directory : ./sample
86
+ run : yarn add $(ls ../decs-typeschema-*.tgz) zod
87
+ - name : Use package
88
+ working-directory : ./sample
89
+ run : |
90
+ echo "
91
+ import {validate} from '@decs/typeschema';
92
+ import {z} from 'zod';
93
+
94
+ export default function Page() {
95
+ validate(z.string(), "hello").then(console.log);
96
+ }
97
+ " > src/app/page.tsx
98
+ - name : Bundle project
99
+ working-directory : ./sample
100
+ run : yarn build
101
+
69
102
check_for_version_upgrade :
70
103
name : Check for version upgrade
71
104
if : |
72
105
github.event_name == 'push' ||
73
106
github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
74
107
runs-on : ubuntu-latest
75
- needs :
76
- - bundle_with_vite
108
+ needs : [bundle_with_vite, bundle_with_nextjs]
77
109
outputs :
78
110
from_version : ${{steps.check.outputs.from_version}}
79
111
to_version : ${{steps.check.outputs.to_version}}
89
121
publish_to_deno :
90
122
name : Publish to Deno
91
123
runs-on : ubuntu-latest
92
- needs :
93
- - check_for_version_upgrade
124
+ needs : check_for_version_upgrade
94
125
if : |
95
126
needs.check_for_version_upgrade.outputs.is_upgraded_version == 'true' &&
96
127
(
@@ -142,8 +173,7 @@ jobs:
142
173
publish_to_npm :
143
174
name : Publish to NPM
144
175
runs-on : ubuntu-latest
145
- needs :
146
- - check_for_version_upgrade
176
+ needs : check_for_version_upgrade
147
177
if : |
148
178
needs.check_for_version_upgrade.outputs.is_upgraded_version == 'true' &&
149
179
(
0 commit comments