Skip to content

Commit 28a6739

Browse files
Upgrade actions to v4 (#66)
1 parent c3f8149 commit 28a6739

File tree

1 file changed

+62
-36
lines changed

1 file changed

+62
-36
lines changed

.github/workflows/update-pnpm.yml

Lines changed: 62 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,74 @@
1-
name: Update pnpm Version and Auto-Merge
1+
name: Test fastify-swc-server CLI
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * *"
6-
workflow_dispatch:
7-
8-
permissions:
9-
contents: write
10-
pull-requests: write
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
118

129
jobs:
13-
update-pnpm:
10+
test:
1411
runs-on: ubuntu-latest
1512

16-
outputs:
17-
pull_request_url: ${{ steps.create-pr.outputs.pull-request-url }}
18-
1913
steps:
20-
- name: Check out the repository
21-
uses: actions/checkout@v3
14+
- name: Checkout code
15+
uses: actions/checkout@v4
2216

23-
- name: Install Corepack
24-
run: npm install -g corepack
17+
- name: Set up SSH
18+
run: |
19+
mkdir -p ~/.ssh
20+
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
21+
chmod 600 ~/.ssh/id_rsa
22+
ssh-keyscan github.com >> ~/.ssh/known_hosts
23+
env:
24+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
2525

26-
- name: Update pnpm Version
27-
run: corepack up
26+
- name: Set up pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: "8.6.0"
2830

29-
- name: Create a pull request
30-
id: create-pr
31-
uses: peter-evans/create-pull-request@v5
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
3233
with:
33-
branch: update-pnpm-version
34-
title: "chore: Update pnpm version via Corepack"
35-
body: "This pull request updates the pnpm version in package.json using Corepack."
36-
labels: update, dependencies
37-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
38-
39-
auto-merge:
40-
needs: update-pnpm
41-
runs-on: ubuntu-latest
42-
if: needs.update-pnpm.outputs.pull_request_url != ''
34+
node-version: "lts/*"
35+
cache: pnpm
4336

44-
steps:
45-
- name: Enable auto-merge for the pull request
46-
run: gh pr merge --auto --merge "${{ needs.update-pnpm.outputs.pull_request_url }}"
47-
env:
48-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Install dependencies (skip prepare script)
38+
run: pnpm install --ignore-scripts
39+
40+
- name: Pack and install CLI globally
41+
run: |
42+
npm pack
43+
sudo npm install -g $(ls fastify-swc-typescript-server-bootstrap-cli-*.tgz)
44+
# Verify CLI is available
45+
fastify-swc-server || echo "CLI installation verified"
46+
47+
- name: Test CLI functionality
48+
run: |
49+
# Create a new project using the CLI
50+
fastify-swc-server test-fastify-project
51+
52+
# Verify project structure
53+
ls -la test-fastify-project
54+
55+
# Change into the new project directory
56+
cd test-fastify-project
57+
58+
# Install dependencies using pnpm
59+
pnpm install
60+
61+
# Test if the project builds successfully
62+
pnpm run build
63+
64+
# Run the project in development mode
65+
pnpm dev &
66+
67+
# Wait briefly for the dev server to start
68+
sleep 5
69+
70+
# Verify the server is running (check localhost:3000 by default or configured port)
71+
curl -I http://localhost:3000 || echo "Server verification skipped"
72+
73+
# Kill the dev server to clean up
74+
pkill -f "node"

0 commit comments

Comments
 (0)