File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,25 +130,26 @@ jobs:
130130 echo "Building and Testing $project"
131131 cd "$project" || return 1
132132
133- # Install dependencies first
134- if ! pnpm install --frozen-lockfile; then
135- echo "::error::pnpm install failed for $project"
136- echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
133+ # Build first — generates IDL and types that pnpm install/tests need
134+ if ! anchor build; then
135+ echo "::error::anchor build failed for $project"
136+ echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
137+ rm -rf target
137138 cd - > /dev/null
138139 return 1
139140 fi
140141
141- # Run anchor build
142- if ! anchor build ; then
143- echo "::error::anchor build failed for $project"
144- echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
142+ # Install dependencies (after build so generated types are available)
143+ if ! pnpm install --frozen-lockfile ; then
144+ echo "::error::pnpm install failed for $project"
145+ echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
145146 rm -rf target
146147 cd - > /dev/null
147148 return 1
148149 fi
149150
150- # Run anchor test
151- if ! anchor test; then
151+ # Run anchor test (--skip-build since we already built above)
152+ if ! anchor test --skip-build ; then
152153 echo "::error::anchor test failed for $project"
153154 echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
154155 rm -rf target node_modules
You can’t perform that action at this time.
0 commit comments