2021-07-25 00:09:44 +02:00
|
|
|
name: Run unit tests on Windows
|
|
|
|
|
2021-07-25 00:12:31 +02:00
|
|
|
on: [push, pull_request]
|
2021-07-25 00:09:44 +02:00
|
|
|
|
2022-06-28 02:29:16 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-07-25 00:09:44 +02:00
|
|
|
jobs:
|
2021-12-30 13:11:36 +01:00
|
|
|
chunk-matrix:
|
2022-06-28 02:29:16 +02:00
|
|
|
permissions:
|
|
|
|
contents: none
|
2021-12-30 13:11:36 +01:00
|
|
|
name: Generate Chunk Matrix
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
CHUNK_COUNT: 8
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
count: ${{ steps.chunk-matrix.outputs.count }}
|
|
|
|
chunks: ${{ steps.chunk-matrix.outputs.chunks }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- id: chunk-matrix
|
|
|
|
name: Generates the Chunk Matrix
|
|
|
|
run: |
|
2023-02-09 08:35:58 +01:00
|
|
|
echo "count=$(php -r 'echo json_encode([ ${{ env.CHUNK_COUNT }} ]);')" >> $GITHUB_OUTPUT
|
|
|
|
echo "chunks=$(php -r 'echo json_encode(range(1, ${{ env.CHUNK_COUNT }} ));')" >> $GITHUB_OUTPUT
|
2023-02-09 19:42:22 +01:00
|
|
|
shell: bash
|
2021-12-30 13:11:36 +01:00
|
|
|
|
2021-07-25 00:09:44 +02:00
|
|
|
tests:
|
2021-12-30 13:11:36 +01:00
|
|
|
name: "Unit Tests - ${{ matrix.chunk }}"
|
2021-07-25 00:09:44 +02:00
|
|
|
|
|
|
|
runs-on: windows-latest
|
2021-12-30 13:11:36 +01:00
|
|
|
needs:
|
|
|
|
- chunk-matrix
|
2021-07-25 00:09:44 +02:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2021-12-30 13:11:36 +01:00
|
|
|
matrix:
|
|
|
|
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
|
|
|
|
chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }}
|
|
|
|
|
|
|
|
env:
|
|
|
|
CHUNK_COUNT: "${{ matrix.count }}"
|
|
|
|
CHUNK_NUMBER: "${{ matrix.chunk }}"
|
2021-12-30 13:38:58 +01:00
|
|
|
PARALLEL_PROCESSES: 4
|
2021-07-25 00:09:44 +02:00
|
|
|
|
|
|
|
steps:
|
2021-07-25 01:01:10 +02:00
|
|
|
- name: Set git to use LF
|
|
|
|
run: |
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
git config --global core.eol lf
|
|
|
|
|
2021-07-25 00:09:44 +02:00
|
|
|
- name: Set up PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
2023-07-21 14:42:18 +02:00
|
|
|
php-version: '8.1'
|
2023-02-20 13:54:55 +01:00
|
|
|
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
|
2021-07-25 00:09:44 +02:00
|
|
|
tools: composer:v2
|
2021-11-29 07:07:14 +01:00
|
|
|
coverage: none
|
2023-02-20 13:49:58 +01:00
|
|
|
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
|
2023-03-12 06:45:23 +01:00
|
|
|
env:
|
|
|
|
fail-fast: true
|
2021-07-25 00:09:44 +02:00
|
|
|
|
2023-08-13 21:05:21 +02:00
|
|
|
- name: PHP Version
|
|
|
|
run: |
|
|
|
|
php -v
|
|
|
|
php -r 'var_dump(PHP_VERSION_ID);'
|
|
|
|
|
2023-09-11 09:29:32 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-25 00:09:44 +02:00
|
|
|
|
|
|
|
- name: Get Composer Cache Directories
|
|
|
|
id: composer-cache
|
|
|
|
run: |
|
2023-02-09 19:42:22 +01:00
|
|
|
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
|
|
|
|
shell: bash
|
2021-07-25 00:09:44 +02:00
|
|
|
|
2023-03-12 07:01:01 +01:00
|
|
|
- name: Generate composer.lock
|
|
|
|
run: |
|
|
|
|
composer update --no-install
|
2023-03-12 07:15:47 +01:00
|
|
|
env:
|
|
|
|
COMPOSER_ROOT_VERSION: dev-master
|
2023-03-12 07:01:01 +01:00
|
|
|
|
2021-07-25 00:09:44 +02:00
|
|
|
- name: Cache composer cache
|
2022-06-30 19:05:06 +02:00
|
|
|
uses: actions/cache@v3
|
2021-07-25 00:09:44 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.composer-cache.outputs.files_cache }}
|
|
|
|
${{ steps.composer-cache.outputs.vcs_cache }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-composer-
|
|
|
|
|
|
|
|
- name: Run composer install
|
|
|
|
run: composer install -o
|
|
|
|
env:
|
|
|
|
COMPOSER_ROOT_VERSION: dev-master
|
|
|
|
|
2021-12-30 13:11:36 +01:00
|
|
|
- name: Generate test suits
|
|
|
|
run: php bin/generate_testsuites.php $env:CHUNK_COUNT
|
|
|
|
|
2021-07-25 00:09:44 +02:00
|
|
|
- name: Run unit tests
|
2023-10-19 13:14:59 +02:00
|
|
|
run: vendor/bin/paratest --processes=$env:PARALLEL_PROCESSES --testsuite=chunk_$env:CHUNK_NUMBER --log-junit build/phpunit/phpunit.xml
|