This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/.github/workflows/intl-data-tests.yml
2021-04-13 21:38:10 +02:00

79 lines
2.3 KiB
YAML

name: Intl data tests
on:
push:
paths:
- 'src/Symfony/Component/Intl/Resources/data/**'
pull_request:
paths:
- 'src/Symfony/Component/Intl/Resources/data/**'
defaults:
run:
shell: bash
jobs:
tests:
name: Tests (intl-data)
runs-on: Ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install system dependencies
run: |
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::install tools & libraries"
sudo apt-get install icu-devtools
echo "::endgroup::"
- name: Define the ICU version
run: |
SYMFONY_ICU_VERSION=$(php -r 'require "src/Symfony/Component/Intl/Intl.php"; echo Symfony\Component\Intl\Intl::getIcuStubVersion();')
echo "SYMFONY_ICU_VERSION=$SYMFONY_ICU_VERSION" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "zip,intl-${{env.SYMFONY_ICU_VERSION}}"
ini-values: "memory_limit=-1"
php-version: "7.4"
- name: Configure composer
run: |
COMPOSER_HOME="$(composer config home)"
composer self-update
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
- name: Determine composer cache directory
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install dependencies
run: |
echo "::group::composer update"
composer update --no-progress --ansi
echo "::endgroup::"
echo "::group::install phpunit"
./phpunit install
echo "::endgroup::"
- name: Report the ICU version
run: uconv -V && php -i | grep 'ICU version'
- name: Run intl-data tests
run: ./phpunit --group intl-data -v