Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 107 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v4

Expand All @@ -29,6 +30,7 @@ jobs:

test:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
needs: lint

strategy:
Expand Down Expand Up @@ -60,6 +62,7 @@ jobs:

test-site:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
needs: lint

steps:
Expand Down Expand Up @@ -109,6 +112,7 @@ jobs:

test-reporter:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
needs: lint

steps:
Expand Down Expand Up @@ -151,6 +155,7 @@ jobs:

test-tui:
runs-on: ubuntu-latest
timeout-minutes: 8
needs: lint

steps:
Expand Down Expand Up @@ -196,6 +201,7 @@ jobs:

test-ruby-client:
runs-on: ubuntu-latest
timeout-minutes: 8
needs: [lint, changes-ruby]
if: needs.changes-ruby.outputs.ruby == 'true'

Expand Down Expand Up @@ -303,8 +309,24 @@ jobs:
- '.github/workflows/ci.yml'
- '.github/workflows/release-swift-client.yml'

changes-ember:
runs-on: ubuntu-latest
outputs:
ember: ${{ steps.filter.outputs.ember }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ember:
- 'clients/ember/**'
- '.github/workflows/ci.yml'
- '.github/workflows/release-ember-client.yml'

test-storybook-client:
runs-on: ubuntu-latest
timeout-minutes: 8
needs: [lint, changes-storybook]
if: needs.changes-storybook.outputs.storybook == 'true'

Expand Down Expand Up @@ -346,6 +368,7 @@ jobs:

test-static-site-client:
runs-on: ubuntu-latest
timeout-minutes: 8
needs: [lint, changes-static-site]
if: needs.changes-static-site.outputs.static-site == 'true'

Expand Down Expand Up @@ -387,6 +410,7 @@ jobs:

test-vitest-client:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
needs: [lint, changes-vitest]
if: needs.changes-vitest.outputs.vitest == 'true'

Expand Down Expand Up @@ -440,6 +464,7 @@ jobs:
CI: true

- name: Run Vitest client E2E tests
if: matrix.node-version == 22
working-directory: ./clients/vitest
run: ../../bin/vizzly.js run "npm run test:e2e"
env:
Expand All @@ -450,6 +475,7 @@ jobs:

test-swift-client:
runs-on: macos-latest
timeout-minutes: 8
needs: [lint, changes-swift]
if: needs.changes-swift.outputs.swift == 'true'

Expand All @@ -471,9 +497,84 @@ jobs:
working-directory: ./clients/swift
run: swift test

test-ember-client:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
needs: [lint, changes-ember]
if: needs.changes-ember.outputs.ember == 'true'

strategy:
matrix:
node-version: [22, 24]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install CLI dependencies
run: npm ci

- name: Build CLI
run: npm run build

- name: Install Ember client dependencies
working-directory: ./clients/ember
run: npm install

- name: Get installed Playwright version
working-directory: ./clients/ember
id: playwright-version
run: echo "version=$(npx playwright --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT

- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ steps.playwright-version.outputs.version }}-chromium

- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./clients/ember
run: npx playwright install chromium --with-deps

- name: Run linter
working-directory: ./clients/ember
run: npm run lint

- name: Run unit tests
working-directory: ./clients/ember
run: npm test
env:
CI: true

- name: Run integration tests
working-directory: ./clients/ember
run: npm run test:integration
env:
CI: true

- name: Run Ember E2E visual tests
if: matrix.node-version == 22
working-directory: ./clients/ember
run: |
cd test-app
npm install
npm run build -- --mode development
../../../bin/vizzly.js run "npx testem ci --file testem.cjs"
env:
CI: true
VIZZLY_TOKEN: ${{ secrets.VIZZLY_EMBER_CLIENT_TOKEN }}
VIZZLY_COMMIT_MESSAGE: ${{ github.event.pull_request.head.commit.message || github.event.head_commit.message }}
VIZZLY_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }}

ci-check:
runs-on: ubuntu-latest
needs: [lint, test, test-site, test-reporter, test-tui, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client]
needs: [lint, test, test-site, test-reporter, test-tui, changes-ruby, test-ruby-client, changes-storybook, test-storybook-client, changes-static-site, test-static-site-client, changes-vitest, test-vitest-client, changes-swift, test-swift-client, changes-ember, test-ember-client]
if: always()
steps:
- name: Check if all jobs passed
Expand Down Expand Up @@ -510,4 +611,9 @@ jobs:
exit 1
fi

if [[ "${{ needs.changes-ember.outputs.ember }}" == "true" && "${{ needs.test-ember-client.result }}" == "failure" ]]; then
echo "Ember client tests failed"
exit 1
fi

echo "All jobs passed"
197 changes: 197 additions & 0 deletions .github/workflows/release-ember-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
name: Release Ember Client

on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
prerelease:
description: 'Create prerelease (beta tag)?'
required: false
default: false
type: boolean

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'

- name: Configure git
run: |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --local user.name "${{ secrets.GIT_USER_NAME }}"

- name: Ensure we have latest main
run: |
git fetch origin main
git reset --hard origin/main

- name: Get current version
id: current_version
working-directory: ./clients/ember
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT

- name: Bump version
id: version
working-directory: ./clients/ember
run: |
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
NEW_VERSION=$(npm version pre${{ github.event.inputs.version_type }} --preid=beta --no-git-tag-version | sed 's/v//')
else
NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }} --no-git-tag-version | sed 's/v//')
fi
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "tag=ember/v$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Generate changelog with Claude
id: changelog
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Generate release notes for the Vizzly Ember SDK v${{ steps.version.outputs.version }}.

Context:
- Client location: `clients/ember/`
- Previous tag: `ember/v${{ steps.current_version.outputs.version }}`
- New version: `${{ steps.version.outputs.version }}`
- This is a monorepo with multiple clients and a CLI

Instructions:
1. Use git commands (via Bash tool) to get commits since last ember/* tag
2. Analyze which commits are relevant to `clients/ember/`
3. Read the code changes if needed to understand impact
4. Generate user-friendly release notes with categories: Added, Changed, Fixed
5. Focus on user-facing changes only
6. If no relevant changes, output: "No changes to Ember SDK in this release"

Save the changelog to `clients/ember/CHANGELOG-RELEASE.md` with this format:

## What's Changed

### Added
- New features

### Changed
- Breaking or notable changes

### Fixed
- Bug fixes

**Full Changelog**: https://github.com/vizzly-testing/cli/compare/ember/v${{ steps.current_version.outputs.version }}...ember/v${{ steps.version.outputs.version }}
claude_args: '--allowed-tools "Bash(git:*),Write"'

- name: Install dependencies
working-directory: ./clients/ember
run: npm install

- name: Run tests
working-directory: ./clients/ember
run: npm test

- name: Run linter
working-directory: ./clients/ember
run: npm run lint

- name: Update CHANGELOG.md
working-directory: ./clients/ember
run: |
# Check if changelog was generated successfully
if [ ! -f CHANGELOG-RELEASE.md ]; then
echo "Warning: CHANGELOG-RELEASE.md not found, creating fallback changelog"
cat > CHANGELOG-RELEASE.md << 'EOF'
## What's Changed

Release v${{ steps.version.outputs.version }}

See the full diff for detailed changes.
EOF
fi

# Prepend new release to CHANGELOG.md
echo -e "# Changelog\n" > CHANGELOG-NEW.md
echo "All notable changes to this project will be documented in this file." >> CHANGELOG-NEW.md
echo "" >> CHANGELOG-NEW.md
echo "The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)," >> CHANGELOG-NEW.md
echo "and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)." >> CHANGELOG-NEW.md
echo "" >> CHANGELOG-NEW.md
echo "## [${{ steps.version.outputs.version }}] - $(date +%Y-%m-%d)" >> CHANGELOG-NEW.md
echo "" >> CHANGELOG-NEW.md
cat CHANGELOG-RELEASE.md >> CHANGELOG-NEW.md
echo "" >> CHANGELOG-NEW.md
tail -n +8 CHANGELOG.md >> CHANGELOG-NEW.md
mv CHANGELOG-NEW.md CHANGELOG.md
rm CHANGELOG-RELEASE.md

- name: Reconfigure git auth
run: |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }} | base64)"

- name: Commit and push changes
run: |
git add clients/ember/package.json clients/ember/CHANGELOG.md
git commit -m "🔖 Ember SDK v${{ steps.version.outputs.version }}"
git push origin main
git tag "${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"

- name: Publish to npm
working-directory: ./clients/ember
run: |
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
npm publish --provenance --access public --tag beta
else
npm publish --provenance --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Read changelog for release
id: release_notes
working-directory: ./clients/ember
run: |
# Extract just this version's changelog
CHANGELOG=$(sed -n '/## \[${{ steps.version.outputs.version }}\]/,/## \[/p' CHANGELOG.md | sed '$ d')
{
echo 'notes<<CHANGELOG_EOF'
echo "$CHANGELOG"
echo 'CHANGELOG_EOF'
} >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: 🐹 Ember SDK v${{ steps.version.outputs.version }}
body: ${{ steps.release_notes.outputs.notes }}
files: ./clients/ember/*.tgz
draft: false
prerelease: ${{ github.event.inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading