Skip to content

Commit

Permalink
Started work on the next version of AntCMS (#86)
Browse files Browse the repository at this point in the history
* Started work on the next version of AntCMS

* Allow the CI on any branch

* Update ci.yml

* Fixed deps for older PHP versions

* Deps don't actually support PHP 8.4 yet

* Added more typehints
  • Loading branch information
BelleNottelling authored Apr 20, 2024
1 parent b4cb7eb commit d660b70
Show file tree
Hide file tree
Showing 36 changed files with 1,442 additions and 449 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: []

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [8.0, 8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
tools: composer:v2
extensions: apcu


- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- run: cp ./tests/Includes/Config.yaml ./src/Config/Config.yaml

- run: php src/Vendor/bin/phpunit tests

PHPStan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- uses: php-actions/phpstan@v3
with:
configuration: phpstan.neon
memory_limit: 256M
version: latest
20 changes: 0 additions & 20 deletions .github/workflows/phpstan.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/unittests.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules
src/Cache/*
src/Config/Config.yaml
src/Config/Pages.yaml
src/Config/Pages.yaml
.php-cs-fixer.cache
15 changes: 15 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude([
'src/Vendor',
])
;

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
])
->setFinder($finder)
;
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"antcms/antloader": "^2.0.0",
"elgigi/commonmark-emoji": "^2.0",
"embed/embed": "^4.4",
"flightphp/core": "^3.8",
"league/commonmark": "^2.3",
"nyholm/psr7": "^1.8",
"shapecode/twig-string-loader": "^1.1",
Expand All @@ -32,8 +33,9 @@
"sort-packages": true
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.54",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.15.4"
"rector/rector": "^1.0.4"
}
}
Loading

0 comments on commit d660b70

Please sign in to comment.