Skip to content

feat: Components parity react <-> vue, animation adjustments #32

feat: Components parity react <-> vue, animation adjustments

feat: Components parity react <-> vue, animation adjustments #32

Workflow file for this run

name: Tests
on:
push:
branches:
- '**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-check:
runs-on: ubuntu-latest
outputs:
has_open_pr: ${{ steps.detect.outputs.has_open_pr }}
steps:
- name: Detect open pull request for current branch
id: detect
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" != "push" || "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "has_open_pr=false" >> "$GITHUB_OUTPUT"
exit 0
fi
branch="${GITHUB_REF#refs/heads/}"
head="${GITHUB_REPOSITORY_OWNER}:${branch}"
api_url="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls"
count="$(
curl -fsSL \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
--get "${api_url}" \
--data-urlencode "state=open" \
--data-urlencode "head=${head}" \
--data-urlencode "per_page=1" \
| python3 -c 'import json,sys; print(len(json.load(sys.stdin)))'
)"
if [[ "${count}" -gt 0 ]]; then
echo "has_open_pr=true" >> "$GITHUB_OUTPUT"
else
echo "has_open_pr=false" >> "$GITHUB_OUTPUT"
fi
eslint:
needs: pr-check
if: github.event_name != 'push' || github.ref == 'refs/heads/main' || needs.pr-check.outputs.has_open_pr != 'true'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 22.x, 24.x ]
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4
- name: Setup Node and dependencies
uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node-version }}
- name: Run eslint
run: yarn eslint
tests:
needs: eslint
timeout-minutes: 90
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 22.x, 24.x ]
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4
- name: Setup Node and dependencies
uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node-version }}
- name: Run test type checks
if: matrix.node-version == '24.x'
run: yarn tsc:tests
- name: Run tests
if: matrix.node-version != '24.x'
run: yarn test
- name: Install Playwright Chromium
if: matrix.node-version == '24.x'
run: yarn playwright install --with-deps chromium
- name: Run merged coverage
if: matrix.node-version == '24.x'
run: |
rm -rf coverage .nyc_output artifacts
mkdir -p coverage/.parts .nyc_output artifacts
yarn test --coverage --coverage.provider=istanbul --coverage.reporter=json --coverage.reportsDirectory=coverage/unit
yarn test:e2e:coverage
cp coverage/unit/coverage-final.json coverage/.parts/unit.json
cp coverage/e2e-react/coverage-final.json coverage/.parts/e2e-react.json
cp coverage/e2e-vue/coverage-final.json coverage/.parts/e2e-vue.json
yarn nyc merge coverage/.parts .nyc_output/coverage-final.json >/dev/null
yarn nyc report
yarn nyc report --reporter=json-summary >/dev/null
yarn node --experimental-strip-types scripts/show-total-coverage.ts
- name: Upload Playwright/Vitest artifacts on failure
if: failure() && matrix.node-version == '24.x'
uses: actions/upload-artifact@v4
with:
name: playwright-vitest-artifacts-node-24
path: artifacts
if-no-files-found: ignore
- name: Upload merged coverage artifacts
if: matrix.node-version == '24.x' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: coverage-node-24
path: |
coverage/lcov.info
coverage/coverage-summary.json
if-no-files-found: error
codecov:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: tests
runs-on: ubuntu-latest
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4
- name: Download merged coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage-node-24
path: coverage
- name: Upload merged coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: combined
name: combined-coverage
fail_ci_if_error: true
verbose: true
storybook-tests:
needs: eslint
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 22.x, 24.x ]
steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4
- name: Setup Node and dependencies
uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node-version }}
- name: Build React Storybook
run: yarn workspace @modulify/m3-react storybook:build --test --quiet
- name: Build Vue Storybook
run: yarn workspace @modulify/m3-vue storybook:build --test --quiet
- name: Run React Storybook smoke tests
run: yarn workspace @modulify/m3-react test:smoke
- name: Run Vue Storybook smoke tests
run: yarn workspace @modulify/m3-vue test:smoke