Skip to content

Commit

Permalink
Merge pull request #348 from studiometa/feature/deps
Browse files Browse the repository at this point in the history
[Feature] Upgrade dependencies
  • Loading branch information
titouanmathis authored Jan 20, 2025
2 parents fe6bb9f + aae4bfe commit e6a9c62
Show file tree
Hide file tree
Showing 9 changed files with 1,461 additions and 579 deletions.
155 changes: 155 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: code-quality

on:
push:
branches:
- master
- develop
pull_request:

jobs:
oxlint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Run code quality tests
run: npm run lint:static

typescript:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Run types tests
run: npm run lint:types


prettier:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Run Prettier check
run: npm run lint:prettier


phpcs:
name: phpcs
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4

- name: Setup PHP, with composer and xdebug
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: PHPCS
run: composer run lint:style

phpstan:
name: phpstan
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4

- name: Setup PHP, with composer and xdebug
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: PHPStan
run: composer run lint:static
45 changes: 7 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,6 @@ on:
pull_request:

jobs:
code_quality:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Run code quality tests
run: npm run lint:static
- name: Run types tests
run: npm run lint:types
- name: Run Prettier check
run: npm run lint:prettier

unit_node:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -77,13 +47,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3']
twig-versions: ['^2.10', '^3']
php-versions: ['8.1', '8.2', '8.3', '8.4']
env:
PHP_VERSION: ${{ matrix.php-versions }}
TWIG_VERSION: ${{ matrix.twig-versions }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
Expand All @@ -110,10 +78,11 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: Install Twig specific version
run: composer require twig/twig:${{ matrix.twig-versions }}
- name: Install Pest v3
run: composer require pest/pest:^3.0
if: ${{ matrix.php-version == '8.4' }}

- name: Pest
run: php -v && XDEBUG_MODE=coverage ./vendor/bin/pest --coverage --coverage-clover='coverage.xml'
Expand All @@ -122,7 +91,7 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PHP_VERSION,TWIG_VERSION
env_vars: PHP_VERSION
file: ./coverage.xml
flags: unittests
fail_ci_if_error: false
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ storybook-static/

# Symbolic docroot
/web
.phpunit.result.cache
/.phpunit.cache/

/packages/docs/.vitepress/dist/
/packages/docs/.vitepress/.temp/
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- **Icon:** add support for icon sets ([#344](https://github.com/studiometa/ui/pull/344), [090b1b1](https://github.com/studiometa/ui/commit/090b1b1))
- **TwigExtension:** add a `meta_icon('collection:icon')` Twig function ([#223](https://github.com/studiometa/ui/issues/223), [#344](https://github.com/studiometa/ui/pull/344), [7dfb635](https://github.com/studiometa/ui/commit/7dfb635))
- Add support for PHP 8.4 ([#348](https://github.com/studiometa/ui/pull/348))

### Changed

- ⚠️ Remove the atomic folders ([#343](https://github.com/studiometa/ui/pull/343), [a61d8e6](https://github.com/studiometa/ui/commit/a61d8e6))
- ⚠️ Upgrade twig/twig to ^3.0 ([#348](https://github.com/studiometa/ui/pull/348), [c8e3830](https://github.com/studiometa/ui/commit/c8e3830))
- ⚠️ Upgrade studiometa/twig-toolkit to ^2.0 ([#348](https://github.com/studiometa/ui/pull/348), [39b43c8](https://github.com/studiometa/ui/commit/39b43c8))

### Removed

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"php": "^8.1",
"iconify/json": "^2.2",
"iconify/json-tools": "^1.0",
"studiometa/twig-toolkit": "^1.3",
"twig/twig": "^2.10|^3"
"studiometa/twig-toolkit": "^2.0",
"twig/twig": "^3.0"
},
"require-dev": {
"mallardduck/prettier-php-runner": "^1.0",
"pestphp/pest": "^1.23",
"pestphp/pest": "^2.0|^3.0",
"phpstan/phpstan": "^2.1",
"spatie/pest-plugin-snapshots": "^1.1",
"spatie/pest-plugin-snapshots": "^2.0",
"squizlabs/php_codesniffer": "^3.6"
},
"scripts": {
Expand Down
Loading

0 comments on commit e6a9c62

Please sign in to comment.