|
| 1 | +name: ci-pkg-cli |
| 2 | +permissions: |
| 3 | + contents: read |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + paths: |
| 8 | + - 'packages/cli/**' |
| 9 | + - 'packages/common/**' |
| 10 | + - 'packages/db/**' |
| 11 | + - 'packages/common-ui/**' |
| 12 | + - 'packages/courseware/**' |
| 13 | + - 'packages/express/**' |
| 14 | + - 'packages/standalone-ui/**' |
| 15 | + - '.github/workflows/ci-pkg-cli.yml' |
| 16 | + - 'package.json' |
| 17 | + - 'yarn.lock' |
| 18 | + |
| 19 | +jobs: |
| 20 | + cli-try-init-e2e: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + submodules: 'recursive' |
| 28 | + |
| 29 | + - name: Display submodule information |
| 30 | + run: | |
| 31 | + echo "Submodule information:" |
| 32 | + git submodule status |
| 33 | + echo "CouchDB snapshot details:" |
| 34 | + cd test-couch && git log -1 --pretty=format:'%h - %s (%cr) <%an>' |
| 35 | +
|
| 36 | + - name: Setup Node.js |
| 37 | + uses: actions/setup-node@v4 |
| 38 | + with: |
| 39 | + node-version: '18' |
| 40 | + cache: 'yarn' |
| 41 | +
|
| 42 | + - name: Setup Docker |
| 43 | + uses: docker/setup-buildx-action@v2 |
| 44 | +
|
| 45 | + - name: Install Yarn |
| 46 | + run: corepack enable |
| 47 | +
|
| 48 | + - name: Install dependencies |
| 49 | + run: yarn install |
| 50 | +
|
| 51 | + - name: Build library packages |
| 52 | + run: | |
| 53 | + yarn build:lib |
| 54 | + yarn workspace @vue-skuilder/mcp build |
| 55 | + yarn workspace @vue-skuilder/express build |
| 56 | + yarn workspace @vue-skuilder/cli build |
| 57 | +
|
| 58 | + - name: Install Cypress |
| 59 | + run: yarn workspace @vue-skuilder/cli cypress install |
| 60 | +
|
| 61 | + - name: Start CouchDB |
| 62 | + run: yarn couchdb:start |
| 63 | +
|
| 64 | + - name: Run try:init to create test project |
| 65 | + working-directory: packages/cli |
| 66 | + run: yarn try:init |
| 67 | +
|
| 68 | + - name: Start scaffolded app dev server and wait for services |
| 69 | + working-directory: packages/cli/testproject |
| 70 | + run: | |
| 71 | + # Start the dev server in background |
| 72 | + npm run dev & |
| 73 | + # Wait for the webserver to be ready |
| 74 | + npx wait-on http://localhost:5173 --timeout 60000 |
| 75 | +
|
| 76 | + - name: Run E2E tests on scaffolded app |
| 77 | + working-directory: packages/cli |
| 78 | + run: yarn test:e2e:headless |
| 79 | +
|
| 80 | + - name: Cleanup services |
| 81 | + if: always() |
| 82 | + run: | |
| 83 | + # Clean up dev server |
| 84 | + kill $(lsof -t -i:5173) || true |
| 85 | + # Clean up CouchDB |
| 86 | + yarn couchdb:stop |
| 87 | +
|
| 88 | + - name: Upload screenshots on failure |
| 89 | + uses: actions/upload-artifact@v4 |
| 90 | + if: failure() |
| 91 | + with: |
| 92 | + name: cypress-screenshots |
| 93 | + path: packages/cli/cypress/screenshots |
| 94 | + retention-days: 7 |
| 95 | +
|
| 96 | + - name: Upload videos |
| 97 | + uses: actions/upload-artifact@v4 |
| 98 | + if: always() |
| 99 | + with: |
| 100 | + name: cypress-videos |
| 101 | + path: packages/cli/cypress/videos |
| 102 | + retention-days: 7 |
0 commit comments