Files
webstudio/.github/workflows/cli-test.yml
T
Jaya Krishna Namburu ac793ca457 chore: Add checks for template names for build command in cli (#2358)
## Description

Small changes that adds checks for templates and hints for templates in
the `--help` command.

## Steps for reproduction

```sh
webstudio-cli --help
```

## Code Review

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)
2023-09-26 06:52:41 +02:00

64 lines
1.6 KiB
YAML

name: Cli tests
on:
push:
branches:
- main
pull_request:
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: cli-${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
checks:
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
DATABASE_URL: postgres://
AUTH_SECRET: test
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
- uses: ./.github/actions/ci-setup
- name: Build cli
run: pnpm turbo run build --filter='webstudio-cli'
# Testing fixtures for vercel template
- name: Test cli --help flag
working-directory: ./fixtures/webstudio-remix-vercel
run: pnpm webstudio-cli --help
- name: Testing cli link command
run: pnpm --filter='./fixtures/*' run fixtures:link
- name: Testing cli sync command
run: pnpm --filter='./fixtures/*' run --parallel fixtures:sync
- name: Testing cli build command
run: pnpm --filter='./fixtures/*' run --parallel fixtures:build
- name: Test git diff
# This command will fail if there are uncommitted changes, i.e something has broken
run: git diff --name-only HEAD --exit-code
- name: Show changed files
if: ${{ failure() }}
run: |
echo "Changed files are:"
git diff --name-only HEAD