Skip to content

Commit f6791a2

Browse files
authored
Merge pull request #69 from niden-code/feature/volt-phase1
Feature/volt phase1
2 parents 2495ae9 + 75111d6 commit f6791a2

33 files changed

Lines changed: 2941 additions & 887 deletions

.github/workflows/continuous-integration.yml

Lines changed: 0 additions & 140 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: "Volt CI"
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
- '**.txt'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions: {}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
16+
17+
jobs:
18+
# PHP CodeSniffer + PHPStan inspection
19+
phpcs:
20+
name: "Validate code style"
21+
22+
permissions:
23+
contents: read
24+
25+
runs-on: ubuntu-latest
26+
27+
strategy:
28+
fail-fast: true
29+
matrix:
30+
php:
31+
- '8.1'
32+
- '8.2'
33+
- '8.3'
34+
- '8.4'
35+
- '8.5'
36+
37+
steps:
38+
- uses: actions/checkout@v6
39+
40+
- name: "Setup PHP"
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php }}
44+
extensions: mbstring, ctype
45+
coverage: none
46+
ini-values: apc.enable_cli=on, session.save_path=/tmp
47+
tools: pecl
48+
env:
49+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Install development dependencies with Composer
52+
uses: ramsey/composer-install@v4
53+
with:
54+
composer-options: "--prefer-dist"
55+
56+
- name: "PHPCS"
57+
run: composer cs
58+
59+
- name: "PHPStan"
60+
run: composer analyze
61+
62+
tests:
63+
name: Unit tests
64+
needs: phpcs
65+
runs-on: ubuntu-latest
66+
67+
permissions:
68+
contents: read
69+
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
php:
74+
- '8.1'
75+
- '8.2'
76+
- '8.3'
77+
- '8.4'
78+
- '8.5'
79+
80+
steps:
81+
- uses: actions/checkout@v6
82+
83+
- name: Setup PHP
84+
uses: shivammathur/setup-php@v2
85+
with:
86+
php-version: ${{ matrix.php }}
87+
extensions: mbstring, ctype
88+
coverage: xdebug
89+
tools: composer:v2
90+
env:
91+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
93+
- name: Validate composer.json
94+
run: composer validate --no-check-all --no-check-publish
95+
96+
- name: Install dependencies
97+
uses: ramsey/composer-install@v4
98+
with:
99+
composer-options: "--prefer-dist"
100+
101+
- name: Run tests
102+
run: composer test
103+
104+
coverage:
105+
name: Code Coverage
106+
needs: tests
107+
runs-on: ubuntu-latest
108+
109+
permissions:
110+
contents: read
111+
112+
steps:
113+
- uses: actions/checkout@v6
114+
115+
- name: Setup PHP
116+
uses: shivammathur/setup-php@v2
117+
with:
118+
php-version: '8.5'
119+
extensions: mbstring, ctype
120+
coverage: xdebug
121+
tools: composer:v2
122+
env:
123+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
125+
- name: Install dependencies
126+
uses: ramsey/composer-install@v4
127+
with:
128+
composer-options: "--prefer-dist"
129+
130+
- name: Run tests with coverage
131+
run: composer test-coverage
132+
133+
- name: Upload coverage to Codecov
134+
uses: codecov/codecov-action@v5
135+
with:
136+
files: ./tests/_output/coverage.xml
137+
fail_ci_if_error: false

.gitignore

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
.idea/
2-
composer.phar
2+
.worktrees/
33
/vendor/
44
/lemon-php/
5-
log.txt
6-
tests/support/output/
7-
tests/support/coverage/
5+
composer.phar
6+
7+
# PHPUnit
8+
.phpunit.result.cache/
9+
tests/_output/
10+
coverage/
11+
coverage.xml
12+
13+
# Volt compiled templates
814
*.volt.php

composer.json

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "phalcon/volt",
3-
"description": "Phalcon Volt is a HTML template engine for sender-side rendering.",
4-
"version": "1.0.0",
3+
"description": "Phalcon Volt is an HTML template engine for server-side rendering.",
4+
"type": "library",
55
"keywords": [
66
"phalcon",
77
"volt",
88
"template",
99
"engine",
10-
"HTML"
10+
"html"
1111
],
12+
"homepage": "https://phalcon.io",
1213
"license": "MIT",
1314
"authors": [
1415
{
@@ -21,11 +22,24 @@
2122
"homepage": "https://github.com/phalcon/volt/graphs/contributors"
2223
}
2324
],
25+
"support": {
26+
"email": "support@phalcon.io",
27+
"issues": "https://github.com/phalcon/volt/issues",
28+
"source": "https://github.com/phalcon/volt",
29+
"discussions": "https://phalcon.io/discussions/",
30+
"docs": "https://phalcon.io/docs/",
31+
"rss": "https://blog.phalcon.io/rss"
32+
},
2433
"require": {
25-
"php": ">=8.1",
26-
"ext-mbstring": "*",
27-
"ext-ctype": "*"
34+
"php": ">=8.1 <9.0",
35+
"ext-ctype": "*",
36+
"ext-mbstring": "*"
37+
},
38+
"suggest": {
39+
"phalcon/phalcon": "The Phalcon framework this module integrates with"
2840
},
41+
"minimum-stability": "stable",
42+
"prefer-stable": true,
2943
"require-dev": {
3044
"pds/skeleton": "^1.0",
3145
"phalcon/ide-stubs": "^5.8",
@@ -54,20 +68,12 @@
5468
"Phalcon\\Tests\\Unit\\": "tests/unit/"
5569
}
5670
},
57-
"support": {
58-
"email": "support@phalcon.io",
59-
"issues": "https://github.com/phalcon/volt/issues",
60-
"discussions": "https://phalcon.io/discussions/",
61-
"source": "https://github.com/phalcon/volt",
62-
"docs": "https://phalcon.io/docs/",
63-
"rss": "https://blog.phalcon.io/rss"
64-
},
6571
"scripts": {
66-
"analyze": "vendor/bin/phpstan analyse -c phpstan.neon",
72+
"analyze": "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 1024M",
6773
"cs": "vendor/bin/phpcs --standard=phpcs.xml",
6874
"cs-fix": "vendor/bin/phpcbf --standard=phpcs.xml",
69-
"test": "vendor/bin/phpunit",
70-
"test-coverage": "vendor/bin/phpunit --coverage-clover ./tests/support/coverage.xml",
71-
"test-coverage-html": "vendor/bin/phpunit --testdox --coverage-html ./tests/support/coverage/"
75+
"test": "vendor/bin/phpunit -c phpunit.xml",
76+
"test-coverage": "vendor/bin/phpunit -c phpunit.xml --coverage-clover tests/_output/coverage.xml",
77+
"test-coverage-html": "vendor/bin/phpunit -c phpunit.xml --coverage-html tests/_output/"
7278
}
7379
}

0 commit comments

Comments
 (0)