1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/.github/workflows/windows-ci.yml

90 lines
2.6 KiB
YAML
Raw Normal View History

name: Run unit tests on Windows
2021-07-25 00:12:31 +02:00
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
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 }}"
2021-12-30 13:38:58 +01:00
PARALLEL_PROCESSES: 4
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
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1
tools: composer:v2
coverage: none
2022-12-22 19:16:38 +01:00
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
- uses: actions/checkout@v3
- name: Get Composer Cache Directories
id: composer-cache
run: |
2023-02-09 08:44:02 +01:00
echo "files_cache=""$(composer config cache-files-dir)""" >> $GITHUB_OUTPUT
echo "vcs_cache=""$(composer config cache-vcs-dir)""" >> $GITHUB_OUTPUT
- name: Cache composer cache
uses: actions/cache@v3
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