Skip to content

feat: improve error handling during project creation #10

feat: improve error handling during project creation

feat: improve error handling during project creation #10

Workflow file for this run

name: Test Templates
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
pm: [npm, pnpm, yarn]
template:
[
next-tailwind,
next-tailwind-basic,
next-tailwind-counter,
react-vite-tailwind,
react-vite-tailwind-basic,
react-vite-tailwind-counter,
]
steps:
- name: Setup Anchor
uses: metadaoproject/setup-anchor@v3.1
with:
anchor-version: '0.30.1'
solana-cli-version: '2.0.21'
node-version: ${{ matrix.node }}
- name: Configure Git identity
run: |
git config --global user.email "ci-bot@example.com"
git config --global user.name "CI Bot"
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: pnpm install
- run: pnpm build
- name: Install package manager (if needed)
run: |
case ${{ matrix.pm }} in
npm) echo "Using npm";;
pnpm) npm install -g pnpm;;
yarn) npm install -g yarn;;
esac
- name: Create and Build using create-solana-dapp
run: |
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
BRANCH='main'
CLI_PATH="${{ github.workspace }}/dist/bin/index.cjs"
case ${{ matrix.pm }} in
npm) node "$CLI_PATH" --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} sandbox ;;
pnpm) node "$CLI_PATH" --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} sandbox --pnpm ;;
yarn) node "$CLI_PATH" --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} sandbox --yarn ;;
esac
cd sandbox
${{ matrix.pm }} install
${{ matrix.pm }} run build