Skip to content

Commit

Permalink
Replace Makefile with castor.php and update workflow
Browse files Browse the repository at this point in the history
A new castor.php file is introduced, replacing the existing Makefile which has been removed. This update modifies the GitHub workflows to call the appropriate Castor tasks. Minor changes are also made to existing source files and static analysis configurations to include the new castor.php file.
  • Loading branch information
Spomky committed Jul 20, 2024
1 parent cc698c6 commit a7dbc24
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/.mergify.yml export-ignore
/babel.config.js export-ignore
/CODE_OF_CONDUCT.md export-ignore
/castor.php export-ignore
/deptrac.yaml export-ignore
/ecs.php export-ignore
/infection.json export-ignore
/jest.config.js export-ignore
/Makefile export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
php-version: "8.3"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "xdebug"

- name: "Checkout code"
Expand All @@ -30,4 +31,4 @@ jobs:
composer-options: "--optimize-autoloader"

- name: "Execute Infection"
run: "make ci-mu"
run: "castor infect"
24 changes: 13 additions & 11 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
php-version: "8.3"
coverage: "none"
tools: "castor"

- name: "Checkout code"
uses: "actions/checkout@v4"
Expand All @@ -42,7 +43,7 @@ jobs:
dependency-versions: "highest"

- name: "Check source code for syntax errors"
run: "composer exec -- parallel-lint src/ tests/"
run: "castor lint"

php_tests:
name: "2️⃣ Unit and functional tests"
Expand All @@ -66,6 +67,7 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "xdebug"

- name: "Checkout code"
Expand All @@ -80,10 +82,7 @@ jobs:
composer-options: "--optimize-autoloader"

- name: "Execute tests (PHP)"
run: "make ci-cc"

- name: "Fix code coverage paths"
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
run: "castor test"

js_tests:
name: "2️⃣ JS tests"
Expand All @@ -103,6 +102,7 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "xdebug"

- name: "Checkout code"
Expand All @@ -117,7 +117,7 @@ jobs:
composer-options: "--optimize-autoloader"

- name: "Execute tests (JS)"
run: "make js"
run: "castor js"

static_analysis:
name: "3️⃣ Static Analysis"
Expand All @@ -131,6 +131,7 @@ jobs:
with:
php-version: "8.3"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "none"

- name: "Checkout code"
Expand All @@ -149,7 +150,7 @@ jobs:
run: "composer dump-autoload --optimize --strict-psr"

- name: "Execute static analysis"
run: "make st"
run: "castor stan"

coding_standards:
name: "4️⃣ Coding Standards"
Expand All @@ -163,6 +164,7 @@ jobs:
with:
php-version: "8.3"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "none"

- name: "Checkout code"
Expand All @@ -181,11 +183,10 @@ jobs:
composer-options: "--optimize-autoloader"

- name: "Check coding style"
run: "make ci-cs"
run: "castor cs"

- name: "Deptrac"
run: |
vendor/bin/deptrac analyse --fail-on-uncovered --no-cache
run: "castor deptrac"

rector_checkstyle:
name: "6️⃣ Rector Checkstyle"
Expand All @@ -199,6 +200,7 @@ jobs:
with:
php-version: "8.3"
extensions: "ctype, curl, dom, json, libxml, mbstring, openssl, phar, simplexml, sodium, tokenizer, xml, xmlwriter, zlib"
tools: "castor"
coverage: "xdebug"

- name: "Checkout code"
Expand All @@ -214,7 +216,7 @@ jobs:
composer-options: "--optimize-autoloader"

- name: "Execute Rector"
run: "make rector"
run: "castor rector"

exported_files:
name: "7️⃣ Exported files"
Expand Down
57 changes: 0 additions & 57 deletions Makefile

This file was deleted.

Loading

0 comments on commit a7dbc24

Please sign in to comment.