-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.73 KB
/
test.yml
File metadata and controls
63 lines (52 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Test Templates
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [20, 22]
pm: [npm, pnpm, yarn]
template: [
# List templates here
templates/template-next-tailwind,
templates/template-react-vite-tailwind,
]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Git identity
run: |
git config --global user.email "ci-bot@example.com"
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:${{ github.repository }}/${{ matrix.template }}#${BRANCH} sandbox ;;
pnpm) pnpx create-solana-dapp@latest --template gh:${{ github.repository }}/${{ matrix.template }}#${BRANCH} sandbox ;;
yarn) yarn create solana-dapp --template gh:${{ github.repository }}/${{ matrix.template }}#${BRANCH} sandbox ;;
esac
cd sandbox
${{ matrix.pm }} install
${{ matrix.pm }} run ci