CI #354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: ~ | |
push: | |
branches: ['main'] | |
schedule: | |
- cron: '0 */12 * * *' | |
jobs: | |
composer-validate: | |
name: Validate composer.json | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
- name: Validate composer.json | |
run: composer validate --strict | |
cs-php: | |
name: Check coding standards | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: php-cs-fixer | |
- name: Run PHP-CS-Fixer | |
run: php-cs-fixer fix . --dry-run --diff | |
sca-php: | |
name: PHPStan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Install composer dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Install PHPUnit | |
run: vendor/bin/simple-phpunit --version | |
- name: Run PHPStan | |
run: vendor/bin/phpstan analyse | |
cs-js: | |
name: JavaScript Coding Style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Get yarn cache directory path | |
working-directory: ./storybook | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- working-directory: ./storybook | |
run: yarn install --immutable | |
- working-directory: ./storybook | |
run: yarn check-lint | |
- working-directory: ./storybook | |
run: yarn check-format | |
tests-php: | |
name: PHPUnit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Install composer dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Run PHPUnit | |
run: vendor/bin/simple-phpunit | |
tests-js: | |
name: Vitest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Get yarn cache directory path | |
working-directory: ./storybook | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- working-directory: ./storybook | |
run: yarn install --immutable | |
- working-directory: ./storybook | |
run: yarn test |