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

Commit 28309cd

Browse files
committed
feat: add GitHub Workflow to test using create-solana-dapp
1 parent 27d78a2 commit 28309cd

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/test-csd.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test Templates
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: [ 18, 20, 22 ]
15+
pm: [ npm, pnpm, yarn ]
16+
template: [ react-vite-tailwind ]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Configure Git identity
23+
run: |
24+
git config --global user.email "[email protected]"
25+
git config --global user.name "CI Bot"
26+
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node }}
31+
32+
- name: Install package manager (if needed)
33+
run: |
34+
case ${{ matrix.pm }} in
35+
npm) echo "Using npm";;
36+
pnpm) npm install -g pnpm;;
37+
yarn) npm install -g yarn;;
38+
esac
39+
40+
- name: Create and Build using create-solana-dapp
41+
run: |
42+
TEMP_DIR=$(mktemp -d)
43+
cd "$TEMP_DIR"
44+
45+
BRANCH=${GITHUB_REF#refs/heads/}
46+
47+
case ${{ matrix.pm }} in
48+
npm) npx create-solana-dapp@latest --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
49+
pnpm) pnpx create-solana-dapp@latest --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
50+
yarn) yarn create solana-dapp --template gh:solana-developers/template-${{ matrix.template }}#${BRANCH} test-${{ matrix.template }} ;;
51+
esac
52+
53+
cd test-${{ matrix.template }}
54+
${{ matrix.pm }} install
55+
${{ matrix.pm }} run build

0 commit comments

Comments
 (0)