Skip to content
Open
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
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push

permissions:
contents: read

jobs:
testsuite:
runs-on: ubuntu-22.04
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup Service
run: |
sudo service mysql start
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, intl, apcu, sqlite, pdo_sqlite, pdo_mysql
ini-values: apc.enable_cli = 1

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

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

- name: composer install
run: |
composer install

- name: Run PHPUnit
run: |
export DB_URL='mysql://root:root@127.0.0.1/cakephp'
vendor/bin/phpunit

coding-standard:
if: false
name: Coding Standard & Static Analysis
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, intl, apcu, sqlite, pdo_sqlite, pdo_mysql
ini-values: apc.enable_cli = 1

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

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

- name: composer install
run: |
composer install

- name: Run PHP CodeSniffer
run: ./vendor/bin/phpcs --colors -p

- name: Run phpstan
if: success() || failure()
run: ./vendor/bin/phpstan analyze
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": ">=8.1",
"cakephp/cakephp": "^5.0.1",
"wikimedia/ip-set": "^2.1"
"wikimedia/ip-utils": "5.0.0"
},
"require-dev": {
"phpunit/phpunit": "^10.1.0",
Expand Down