Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflow configurations and dependencies #66

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -71,6 +71,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
uses: actions/dependency-review-action@v3
35 changes: 35 additions & 0 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: "Integrate"

on:
push:
branches:
- "*.x"

jobs:
mutation_testing:
name: "5️⃣ Mutation Testing"
runs-on: "ubuntu-latest"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
extensions: "ctype, dom, json, libxml, mbstring, openssl, phar, simplexml, tokenizer, xml, xmlwriter"
coverage: "xdebug"

- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Fetch Git base reference"
run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}"

- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
composer-options: "--optimize-autoloader"

- name: "Execute Infection"
run: "make ci-mu"
53 changes: 12 additions & 41 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Check file permissions"
run: |
Expand All @@ -35,10 +35,10 @@ jobs:
coverage: "none"

- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

Expand Down Expand Up @@ -71,10 +71,10 @@ jobs:
coverage: "xdebug"

- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--optimize-autoloader"
Expand Down Expand Up @@ -105,13 +105,13 @@ jobs:
coverage: "none"

- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Validate Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
composer-options: "--optimize-autoloader"
Expand All @@ -137,10 +137,10 @@ jobs:
coverage: "none"

- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
composer-options: "--optimize-autoloader"
Expand All @@ -152,35 +152,6 @@ jobs:
run: |
vendor/bin/deptrac analyse --fail-on-uncovered --no-cache

mutation_testing:
name: "5️⃣ Mutation Testing"
needs:
- "byte_level"
- "syntax_errors"
runs-on: "ubuntu-latest"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
extensions: "ctype, dom, json, libxml, mbstring, openssl, phar, simplexml, tokenizer, xml, xmlwriter"
coverage: "xdebug"

- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Fetch Git base reference"
run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "--optimize-autoloader"

- name: "Execute Infection"
run: "make ci-mu"

rector_checkstyle:
name: "6️⃣ Rector Checkstyle"
needs:
Expand All @@ -196,13 +167,13 @@ jobs:
coverage: "xdebug"

- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Fetch Git base reference"
run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
composer-options: "--optimize-autoloader"
Expand All @@ -218,7 +189,7 @@ jobs:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Check exported files"
run: |
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/merge-me.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
"require-dev": {
"ext-json": "*",
"ekino/phpstan-banned-code": "^1.0",
"infection/infection": "^0.27",
"infection/infection": "^0.28",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-beberlei-assert": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^10.1",
"rector/rector": "^0.19",
"rector/rector": "^1.0",
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^6.0|^7.0",
"symplify/easy-coding-standard": "^12.0",
Expand Down
16 changes: 8 additions & 8 deletions src/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
}

return $object;
case CBORObject::MAJOR_TYPE_TEXT_STRING : //3
case CBORObject::MAJOR_TYPE_TEXT_STRING: //3
$object = IndefiniteLengthTextStringObject::create();
while (! ($it = $this->process($stream, true)) instanceof BreakObject) {
if (! $it instanceof TextStringObject) {
Expand All @@ -162,7 +162,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
}

return $object;
case CBORObject::MAJOR_TYPE_LIST : //4
case CBORObject::MAJOR_TYPE_LIST: //4
$object = IndefiniteLengthListObject::create();
$it = $this->process($stream, true);
while (! $it instanceof BreakObject) {
Expand All @@ -171,23 +171,23 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
}

return $object;
case CBORObject::MAJOR_TYPE_MAP : //5
case CBORObject::MAJOR_TYPE_MAP: //5
$object = IndefiniteLengthMapObject::create();
while (! ($it = $this->process($stream, true)) instanceof BreakObject) {
$object->add($it, $this->process($stream, false));
}

return $object;
case CBORObject::MAJOR_TYPE_OTHER_TYPE : //7
case CBORObject::MAJOR_TYPE_OTHER_TYPE: //7
if (! $breakable) {
throw new InvalidArgumentException('Cannot parse the data. No enclosing indefinite.');
}

return BreakObject::create();
case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER : //0
case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER : //1
case CBORObject::MAJOR_TYPE_TAG : //6
default :
case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER: //0
case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER: //1
case CBORObject::MAJOR_TYPE_TAG: //6
default:
throw new InvalidArgumentException(sprintf(
'Cannot parse the data. Found infinite length for Major Type "%s" (%d).',
str_pad(decbin($mt), 5, '0', STR_PAD_LEFT),
Expand Down
Loading