diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index 7eb6a54196..bad9aa2207 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -37,10 +37,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Lint PHP files + run: ./test/ci-phplint - name: Use php 7.1 uses: shivammathur/setup-php@v2 with: php-version: 7.1 + extensions: mbstring, iconv, mysqli, zip, gd tools: composer:v2 - name: Validate composer.json and composer.lock run: composer validate @@ -71,6 +74,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: 7.2 + extensions: mbstring, iconv, mysqli, zip, gd tools: composer:v2 - name: Cache module uses: actions/cache@v2 diff --git a/.github/workflows/other-tools.yml b/.github/workflows/other-tools.yml index d64b9e3834..385e1ce834 100644 --- a/.github/workflows/other-tools.yml +++ b/.github/workflows/other-tools.yml @@ -29,7 +29,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: 7.1 - extensions: mbstring, iconv + extensions: mbstring, iconv, mysqli, zip, gd tools: composer:v2 - name: Cache module uses: actions/cache@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfabc95690..b3f84dc8c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, iconv + extensions: mbstring, iconv, mysqli, zip, gd coverage: xdebug + tools: composer:v2 - name: Cache module uses: actions/cache@v2 with: @@ -43,6 +44,9 @@ jobs: run: composer run phpunit -- --exclude-group selenium - name: Send coverage uses: codecov/codecov-action@v1 + with: + flags: unit-${{ matrix.php-version }}-${{ matrix.os }} + name: phpunit-${{ matrix.php-version }}-${{ matrix.os }} - name: Send coverage to Scrutinizer uses: sudo-bot/action-scrutinizer@latest # Upload can fail on forks @@ -74,8 +78,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, dbase, iconv + extensions: dbase, mbstring, iconv, mysqli, zip, gd coverage: xdebug + tools: composer:v2 - name: Cache module uses: actions/cache@v2 with: @@ -87,6 +92,57 @@ jobs: run: composer run phpunit -- --exclude-group selenium - name: Send coverage uses: codecov/codecov-action@v1 + with: + flags: dbase-extension + name: php-7.1-dbase-enabled + - name: Send coverage to Scrutinizer + uses: sudo-bot/action-scrutinizer@latest + # Upload can fail on forks + continue-on-error: true + with: + cli-args: "--format=php-clover build/logs/clover.xml" + - name: Send coverage to Codacy + # Upload can fail on forks or if the secret is missing + continue-on-error: true + uses: codacy/codacy-coverage-reporter-action@master + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: build/logs/clover.xml + + test-php-recode: + name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + php-version: ["7.1"] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: Install gettext + run: sudo apt-get install -y gettext + - name: Generate mo files + run: ./scripts/generate-mo --quiet + - name: Use php ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: recode, mbstring, iconv, mysqli, zip, gd + coverage: xdebug + tools: composer:v2 + - name: Cache module + uses: actions/cache@v2 + with: + path: ~/.composer/cache/ + key: composer-cache + - name: Install dependencies + run: composer install + - name: Run php tests + run: composer run phpunit -- --exclude-group selenium + - name: Send coverage + uses: codecov/codecov-action@v1 + with: + flags: recode-extension + name: php-7.1-recode-enabled - name: Send coverage to Scrutinizer uses: sudo-bot/action-scrutinizer@latest # Upload can fail on forks @@ -118,8 +174,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring - coverage: xdebug + extensions: mbstring, iconv, mysqli, zip, gd + tools: composer:v2 - name: Cache module uses: actions/cache@v2 with: diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index a43df95c0e..841cb1e9de 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -97,7 +97,7 @@ class EncodingTest extends AbstractTestCase } } - _setlocale(LC_ALL, 'POSIX') + _setlocale(LC_ALL, 'POSIX'); if (PHP_INT_SIZE === 8) { $GLOBALS['cfg']['IconvExtraParams'] = '//TRANSLIT';