Skip to content

Commit 94e256e

Browse files
Enhance GitHub Actions workflow for create-plugma by adding build, test, and verification steps for plugin and widget creation.
1 parent e61d213 commit 94e256e

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

.github/workflows/run-create-plugma.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,38 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: |
25-
cd packages/create-plugma # Navigate to the subfolder containing your CLI
25+
cd packages/create-plugma
2626
npm install
2727
28-
- name: Install expect
29-
run: sudo apt-get install -y expect
28+
- name: Build create-plugma
29+
run: |
30+
cd packages/create-plugma
31+
npm run build
32+
33+
- name: Create test directory
34+
run: |
35+
mkdir -p test-output
36+
37+
- name: Test plugin creation
38+
run: |
39+
cd test-output
40+
node ../packages/create-plugma/dist/create-plugma.js plugin react --dir TestPlugin --yes --no-install
41+
42+
- name: Test widget creation
43+
run: |
44+
cd test-output
45+
node ../packages/create-plugma/dist/create-plugma.js widget svelte --dir TestWidget --yes --no-install
3046
31-
- name: Run create-plugma CLI
47+
- name: Verify plugin project
3248
run: |
33-
expect <<EOF
34-
spawn npx create-plugma
35-
expect "Select a framework:"
36-
send "\r"
37-
expect "Select a variant:"
38-
send "\r"
39-
expect "Project name:"
40-
send "TestProject\r"
41-
expect "Next:"
42-
EOF
43-
44-
- name: Check if project directory was created
49+
test -d test-output/TestPlugin
50+
test -f test-output/TestPlugin/package.json
51+
test -f test-output/TestPlugin/manifest.json
52+
test -d test-output/TestPlugin/src
53+
54+
- name: Verify widget project
4555
run: |
46-
test -d TestProject # Confirm the project directory was created
47-
test -f TestProject/package.json # Check for package.json as an indicator of successful setup
56+
test -d test-output/TestWidget
57+
test -f test-output/TestWidget/package.json
58+
test -f test-output/TestWidget/manifest.json
59+
test -d test-output/TestWidget/src

0 commit comments

Comments
 (0)