-
Notifications
You must be signed in to change notification settings - Fork 661
106 lines (86 loc) · 3.2 KB
/
windows-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Run unit tests on Windows
on: [push, pull_request]
permissions:
contents: read
jobs:
chunk-matrix:
permissions:
contents: none
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: |
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
shell: bash
tests:
name: "Unit Tests - ${{ matrix.chunk }}"
runs-on: windows-latest
needs:
- chunk-matrix
strategy:
fail-fast: false
matrix:
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }}
env:
CHUNK_COUNT: "${{ matrix.count }}"
CHUNK_NUMBER: "${{ matrix.chunk }}"
PARALLEL_PROCESSES: 4
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
#ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
ini-values: zend.assertions=1, assert.exception=1
tools: composer:v2
coverage: none
#extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
env:
fail-fast: true
- name: PHP Version
run: |
php -v
php -r 'var_dump(PHP_VERSION_ID);'
- uses: actions/checkout@v4
- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
shell: bash
- name: Generate composer.lock
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master
- name: Cache composer cache
uses: actions/cache@v4
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
- name: Generate test suits
run: php bin/generate_testsuites.php $env:CHUNK_COUNT
- name: Run unit tests
run: vendor/bin/paratest --processes=$env:PARALLEL_PROCESSES --testsuite=chunk_$env:CHUNK_NUMBER --log-junit build/phpunit/phpunit.xml