Skip to content

Commit

Permalink
Merge tag '5.23.1' into fix-core-function-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcev106 committed Apr 5, 2024
2 parents c6879ef + 8471a89 commit e9db96e
Show file tree
Hide file tree
Showing 752 changed files with 41,230 additions and 13,876 deletions.
13 changes: 10 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
# See https://app.circleci.com/pipelines/github/vimeo/psalm
version: 2.1
executors:
php-74:
Expand All @@ -10,6 +11,9 @@ executors:
php-81:
docker:
- image: thecodingmachine/php:8.1-v4-cli
php-82:
docker:
- image: thecodingmachine/php:8.2-v4-cli
jobs:
"Code Style Analysis":
executor: php-74
Expand Down Expand Up @@ -37,7 +41,7 @@ jobs:

- run:
name: Code Style Analysis with PHPCS
command: vendor/bin/phpcs
command: vendor/bin/phpcs -d memory_limit=512M

phar-build:
executor: php-74
Expand All @@ -49,7 +53,8 @@ jobs:
command: bin/build-phar.sh
- run:
name: Smoke test Phar file
command: build/psalm.phar --version
# Change the root away from the project root to avoid conflicts with the Composer autoloader
command: build/psalm.phar --version --root build
- store_artifacts:
path: build/psalm.phar
- run:
Expand All @@ -62,8 +67,10 @@ jobs:
root: /home/docker/project/
paths:
- build/psalm.phar
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
resource_class: large
test-with-real-projects:
executor: php-81
executor: php-82
steps:
- checkout # used here just for the side effect of loading the github public ssh key so we can clone other stuff
- attach_workspace:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/bcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ jobs:
php-version: '8.1'
tools: composer:v2
coverage: none
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
- name: Cache composer cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected].0
uses: fkirc/[email protected].1
with:
concurrent_skipping: always
cancel_others: true
Expand All @@ -41,19 +41,25 @@ jobs:
php-version: '7.4'
tools: composer:v2
coverage: none
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for composer to automatically detect root package version

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
- name: Cache composer cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
Expand Down
95 changes: 81 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ jobs:
php-version: '7.4'
tools: composer:v2
coverage: none
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
Expand All @@ -41,6 +49,51 @@ jobs:

- run: |
git ls-files | grep \\\.php$ | grep -v ^dictionaries/scripts/* | ./vendor/bin/parallel-lint --stdin
code-style:
name: Code Style Analysis
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none
env:
fail-fast: true

- 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
- 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: Code Style Analysis with PHPCS
run: vendor/bin/phpcs -d memory_limit=512M

chunk-matrix:
permissions:
contents: none
Expand All @@ -58,11 +111,11 @@ jobs:
- id: chunk-matrix
name: Generates the Chunk Matrix
run: |
echo "::set-output name=count::$(php -r 'echo json_encode([ ${{ env.CHUNK_COUNT }} ]);')"
echo "::set-output name=chunks::$(php -r 'echo json_encode(range(1, ${{ env.CHUNK_COUNT }} ));')"
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 }}"
name: "Unit Tests - PHP ${{ matrix.php-version }} ${{ matrix.chunk }}/${{ matrix.count }}"

runs-on: ubuntu-latest
needs:
Expand All @@ -71,34 +124,48 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
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: 5
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
ini-values: zend.assertions=1, assert.exception=1
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, opcache, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Pull Request Labels
name: Pull Request Labels (to be added by maintainers)
on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/shepherd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
ini-values: zend.assertions=1
tools: composer:v2
coverage: none
env:
fail-fast: true

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
- id: chunk-matrix
name: Generates the Chunk Matrix
run: |
echo "::set-output name=count::$(php -r 'echo json_encode([ ${{ env.CHUNK_COUNT }} ]);')"
echo "::set-output name=chunks::$(php -r 'echo json_encode(range(1, ${{ env.CHUNK_COUNT }} ));')"
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 }}"
Expand Down Expand Up @@ -54,21 +55,30 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
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@v3
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/vendor-bin/*/composer.lock
/vendor-bin/*/vendor/
/tests/fixtures/symlinktest/*

.vscode
.idea/
.vscode/
.php-version
11 changes: 9 additions & 2 deletions bin/github-deploy-phar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ git config user.email "[email protected]"
git config user.name "Automated commit"
git add --all .
git commit -m "Updated Psalm phar to commit ${GITHUB_SHA}"
git push origin master

tag=${GITHUB_REF/refs\/heads\//}
tag=${tag/refs\/tags\//}

if [[ "$tag" != 'master' ]] ; then
git tag "$tag"
git push origin "$tag"
fi

# this script runs on:
# 1. pushes to master
# 2. publishing releases
#
# So we push master to psalm/phar:master
# and tags to psalm/phar:$tag

git push origin "$tag"
1 change: 1 addition & 0 deletions bin/test-with-real-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ psl)
cd endtoend-test-psl
git checkout 2.3.x
composer install
sed 's/ErrorOutputBehavior::Packed, ErrorOutputBehavior::Discard/ErrorOutputBehavior::Discard/g' -i src/Psl/Shell/execute.php
"$PSALM" --monochrome -c config/psalm.xml
"$PSALM" --monochrome -c config/psalm.xml tests/static-analysis
;;
Expand Down
Loading

0 comments on commit e9db96e

Please sign in to comment.