-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (45 loc) · 1.86 KB
/
cli.yml
File metadata and controls
55 lines (45 loc) · 1.86 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
name: CLI test
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm install --save-dev create-frontend-component
- name: Run CLI to init config
run: npx create-frontend-component init vue3
- name: Run CLI to generate a component
run: npx create-frontend-component test-component --type molecules --flavour default
- name: Verify Generated Files (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
test -d src/components/molecules/TestComponent && echo "Component directory exists"
test -f src/components/molecules/TestComponent/TestComponent.vue && echo "Vue file exists"
test -f src/components/molecules/TestComponent/TestComponent.stories.mdx && echo "MDX file exists"
- name: Verify Generated Files (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
if (!(Test-Path "src/components/molecules/TestComponent" -PathType Container)) { exit 1 }
if (!(Test-Path "src/components/molecules/TestComponent/TestComponent.vue")) { exit 1 }
if (!(Test-Path "src/components/molecules/TestComponent/TestComponent.stories.mdx")) { exit 1 }
- name: Cleanup (Linux/macOS)
if: matrix.os != 'windows-latest'
run: rm -rf src/components/molecules/TestComponent
- name: Cleanup (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: Remove-Item -Recurse -Force src/components/molecules/TestComponent