Skip to content

Refactor(repo): Use sharable typescript-config-spirit in tsconfig files #5251

Refactor(repo): Use sharable typescript-config-spirit in tsconfig files

Refactor(repo): Use sharable typescript-config-spirit in tsconfig files #5251

Workflow file for this run

name: 'πŸ” Web Twig: Code Quality Checks'
on:
# Run this workflow on push to branches only (not tags)
push:
branches:
- '**'
paths:
- packages/web-twig/**
# Changes in SVG icons also affect snapshots in web-twig package
# e.g. svg content is generated into the snapshot
- packages/icons/**
pull_request:
paths:
- packages/web-twig/**
# Changes in SVG icons also affect snapshots in web-twig package
# e.g. svg content is generated into the snapshot
- packages/icons/**
jobs:
prepare-icons:
name: πŸ“± Preparing Icons
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node and Install Dependencies
uses: ./.github/actions/setup-install
- name: Build Icons
working-directory: ./packages/icons
run: yarn build
- name: Save built icons
uses: actions/upload-artifact@v4
with:
name: icons-dist
path: ./packages/icons/dist
unit-tests:
needs: [prepare-icons]
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
dependencies: ['']
name: πŸ§ͺ Unit Testing - PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}
steps:
- uses: actions/checkout@v4
- name: Download built icons
uses: actions/download-artifact@v4
with:
name: icons-dist
path: ./packages/icons/dist
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: json, mbstring
coverage: xdebug
- name: Install dependencies
working-directory: ./packages/web-twig
run: composer update --no-progress --no-interaction ${{ matrix.dependencies }}
- name: Copy Assets
working-directory: ./packages/web-twig
run: cp ../icons/dist/svg/* ./static
- name: Run tests
working-directory: ./packages/web-twig
run: |
composer phpunit:coverage
# Publish code coverage after the code is public
- name: Submit coverage to Coveralls
working-directory: ./packages/web-twig
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ github.job }}-PHP-${{ matrix.php-version }} ${{ matrix.dependencies }}
run: |
composer global require php-coveralls/php-coveralls
~/.composer/vendor/bin/php-coveralls --coverage_clover=coverage/clover.xml --json_path=coverage/coveralls-upload.json -v
finalize-tests:
name: 🏁 Finalizing Tests
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
flag-name: web-twig
carryforward: web, web-react, analytics, design-tokens, icons, common, codemods, form-validations
codestyle:
name: 'πŸ“ Analyzing Code Style and Types'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, mbstring
- name: Install dependencies
working-directory: ./packages/web-twig
run: composer update --no-progress
- name: Run lint
working-directory: ./packages/web-twig
run: composer lint
- name: Run checks
working-directory: ./packages/web-twig
run: composer analyze