Skip to content
Closed
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
21 changes: 21 additions & 0 deletions .github/actions/install-root-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Install root dependencies
runs:
using: composite
steps:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
shell: bash

- name: Cache root Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-root-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-root-

- name: Install root Composer dependencies
run: composer install
shell: bash
27 changes: 27 additions & 0 deletions .github/actions/install-website-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Install website dependencies
inputs:
dependency-version:
description: 'The version of dependencies to install. Can be "locked" or "highest"'
default: 'locked'
required: false
runs:
using: composite
steps:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
shell: bash

- name: Cache website Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-website-${{ inputs.dependency-version }}-${{ hashFiles('ux.symfony.com/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-website-${{ inputs.dependency-version }}-

- name: Install website Composer dependencies
run: composer ${{ inputs.dependency-version == 'highest' && 'update' || 'install' }}
shell: bash
working-directory: ux.symfony.com
16 changes: 14 additions & 2 deletions .github/workflows/app-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ jobs:

- uses: shivammathur/setup-php@v2

- name: Install root dependencies
run: composer install
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Testing apps dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-testing-app-${{ matrix.ux-packages-source }}-${{ hashFiles('test_apps/**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-testing-app-${{ matrix.ux-packages-source }}-

- uses: ./.github/actions/install-root-dependencies

- name: Build root packages
run: php .github/build-packages.php
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ jobs:
php-version: 8.1
tools: flex

- name: Install root dependencies
run: composer install
- uses: ./.github/actions/install-root-dependencies

- name: Build root packages
run: php .github/build-packages.php
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- '.github/workflows/functional-tests.yml'
- 'src/Turbo/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

Comment on lines +13 to +16
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found functional tests were not canceled when pushing a new commit when they are already running.

jobs:
turbo-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,8 +60,20 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: flex

- name: Install root dependencies
run: composer install
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache packages dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-turbo-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-turbo-${{ matrix.php-version }}-

- uses: ./.github/actions/install-root-dependencies

- name: Build root packages
run: php .github/build-packages.php
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/toolkit-kits-code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ jobs:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
php-version: 8.3
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-kits-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-kits-

- name: Install composer packages
uses: ramsey/composer-install@v3
with:
working-directory: src/Toolkit
run: composer install
working-directory: src/Toolkit

- name: Check kits code style
run: php vendor/bin/twig-cs-fixer check kits
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,20 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: flex

- name: Install root dependencies
run: composer install
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache packages dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-

- uses: ./.github/actions/install-root-dependencies

- name: Build root packages
run: php .github/build-packages.php
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/ux.symfony.com.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
working-directory: ux.symfony.com
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: php-cs-fixer
- name: Install dependencies
uses: ramsey/composer-install@v3
with:
working-directory: ux.symfony.com

- uses: ./.github/actions/install-website-dependencies

- name: php-cs-fixer
run: php-cs-fixer check --diff

Expand All @@ -45,13 +45,13 @@ jobs:
working-directory: ux.symfony.com
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Install dependencies
uses: ramsey/composer-install@v3
with:
working-directory: ux.symfony.com

- uses: ./.github/actions/install-website-dependencies

- name: twig-cs-fixer
run: vendor/bin/twig-cs-fixer lint templates --report=github

Expand All @@ -63,24 +63,26 @@ jobs:
working-directory: ux.symfony.com
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Install root dependencies
uses: ramsey/composer-install@v3
with:
working-directory: ${{ github.workspace }}

- uses: ./.github/actions/install-root-dependencies

- name: Build root packages
run: php .github/build-packages.php
working-directory: ${{ github.workspace }}
- name: Install dependencies
uses: ramsey/composer-install@v3

- uses: ./.github/actions/install-website-dependencies
with:
working-directory: ux.symfony.com
dependency-versions: 'highest'

- name: Importmap dependencies
run: php bin/console importmap:install

- name: Build Sass assets
run: php bin/console sass:build

- name: Tests
run: vendor/bin/phpunit
Loading