Skip to content

Commit

Permalink
chore: add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Feb 8, 2025
1 parent 818a576 commit 1f8f0ae
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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

0 comments on commit 1f8f0ae

Please sign in to comment.