Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

feat: add GitHub Workflow to test using create-solana-dapp #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/test-csd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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: [ react-vite-tailwind ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "CI Bot"

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- 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=${GITHUB_REF#refs/heads/}

case ${{ matrix.pm }} in
npm) npx create-solana-dapp@latest --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
pnpm) pnpx create-solana-dapp@latest --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
yarn) yarn create solana-dapp --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
esac

cd test-${{ matrix.template }}
${{ matrix.pm }} install
${{ matrix.pm }} run build