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

on: push

jobs:
php-tests:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
experimental: [false]
php:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5
include:
- php: 8.6
prefer: stable
experimental: true
prefer:
- lowest
- stable
fail-fast: false

name: Test on PHP ${{ matrix.php }} with ${{ matrix.prefer }} composer prefer option
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Check PHP Version
run: php -v

- name: Xdebug Action
uses: MilesChou/docker-xdebug@master

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.prefer }}-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --prefer-${{ matrix.prefer }} --prefer-dist --no-progress

- name: Run tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash)
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM php:8.3-cli
ARG PHP_VERSION=8.4

FROM php:${PHP_VERSION}-cli

# Composer requirements begin
RUN apt-get update \
Expand All @@ -8,7 +10,7 @@ RUN apt-get update \

RUN docker-php-ext-install zip

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# Composer requirements end

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PATH := $(shell pwd)/bin:$(PATH)
$(shell cp --update=none dev.env .env)
$(shell cp -n dev.env .env)
include .env

install: build
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "BSD-2-Clause",
"authors": [],
"require-dev": {
"phpunit/phpunit": "^12.1"
"phpunit/phpunit": "*"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions dev.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PHP_DEV_IMAGE=samizdam/skeleton/php-dev
PHP_VERSION=8.4
# default tag for images, replaced with CI environment value: branch or tag name
REVISION=master
Empty file added tests/.gitkeep
Empty file.
Loading