Skip to content

chore(deps): update dependency dprint to ^0.54.0 #177

chore(deps): update dependency dprint to ^0.54.0

chore(deps): update dependency dprint to ^0.54.0 #177

Workflow file for this run

name: Integration Test
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
test:
name: Generate ${{ matrix.template }} with ${{ matrix.pkg-manager }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pkg-manager: [npm, yarn, pnpm]
template: [vanilla, vanilla-ts, react, react-ts, vue, vue-ts]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup pnpm
if: matrix.pkg-manager == 'pnpm'
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install dependencies
run: npm ci
- name: Get pnpm store directory
if: matrix.pkg-manager == 'pnpm'
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Cache pnpm modules
if: matrix.pkg-manager == 'pnpm'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('package-lock.json', 'template-*/package.json') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Get yarn cache directory
if: matrix.pkg-manager == 'yarn'
id: yarn-cache-dir
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn modules
if: matrix.pkg-manager == 'yarn'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package-lock.json', 'template-*/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run Integration Test
shell: bash
run: |
PROJECT_NAME="test-app-${{ matrix.pkg-manager }}-${{ matrix.template }}"
export CREATE_HARPER_SKIP_UPDATE=true
echo "Testing with ${{ matrix.pkg-manager }} and ${{ matrix.template }}..."
case ${{ matrix.pkg-manager }} in
npm)
npx . "$PROJECT_NAME" --template ${{ matrix.template }} --no-interactive --overwrite --skip-install
;;
yarn)
corepack enable
yarn node index.js "$PROJECT_NAME" --template ${{ matrix.template }} --no-interactive --overwrite --skip-install
;;
pnpm)
pnpm exec node index.js "$PROJECT_NAME" --template ${{ matrix.template }} --no-interactive --overwrite --skip-install
;;
esac
# Verification
if [ ! -d "$PROJECT_NAME" ]; then
echo "Error: Project directory $PROJECT_NAME was not created"
exit 1
fi
if [ ! -f "$PROJECT_NAME/package.json" ]; then
echo "Error: package.json was not created in $PROJECT_NAME"
exit 1
fi
cd "$PROJECT_NAME"
echo "Installing dependencies..."
case ${{ matrix.pkg-manager }} in
npm)
npm install
;;
yarn)
yarn install
;;
pnpm)
pnpm install
;;
esac
echo "Running lint..."
${{ matrix.pkg-manager }} run lint
echo "Running format check..."
${{ matrix.pkg-manager }} run format
echo "Running tests..."
${{ matrix.pkg-manager }} run test
# Check for build script and run it if exists
if grep -q '"build":' package.json; then
echo "Running build..."
${{ matrix.pkg-manager }} run build
fi
echo "Integration test passed for ${{ matrix.pkg-manager }} with ${{ matrix.template }}!"