Skip to content

Commit

Permalink
ECS & Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Mar 22, 2024
1 parent 6300362 commit 5d7637e
Show file tree
Hide file tree
Showing 17 changed files with 7,016 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [janhenckens]
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Code Quality
on:
workflow_dispatch:
pull_request:
push:
branches:
- develop
- develop-v5
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: ci
uses: studioespresso/.github/.github/workflows/ci.yml@main
with:
craft_version: '5'
jobs: '["ecs", "phpstan"]'
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Code Coverage (PHP)

on: [push, pull_request]

jobs:
tests:
name: Coverage
runs-on: ubuntu-latest

env:
DB_DATABASE: scout_testing
DB_USER: root
DB_PASSWORD: root
DB_PORT: 3306
DB_DRIVER: mysql

steps:
- uses: actions/checkout@v3

- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: 8.0
extensions: mbstring,dom,fileinfo,mysql,imagick,bcmath,pcntl,zip,soap,intl,gd,exif,iconv
key: extensions

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: mbstring,dom,fileinfo,mysql,imagick,bcmath,pcntl,zip,soap,intl,gd,exif,iconv
coverage: xdebug

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

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-suggest
- name: Run tests
run: |
mkdir -p build/logs
./vendor/bin/codecept run unit --coverage-xml coverage.xml;
bash <(curl -s https://codecov.io/bash)
env:
APP_ENV: testing
20 changes: 20 additions & 0 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Create Release
run-name: Create release for ${{ github.event.client_payload.version }}

on:
repository_dispatch:
types:
- craftcms/new-release
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: ncipollo/release-action@v1
with:
body: ${{ github.event.client_payload.notes }}
makeLatest: ${{ github.event.client_payload.latest }}
name: ${{ github.event.client_payload.version }}
prerelease: ${{ github.event.client_payload.prerelease }}
tag: ${{ github.event.client_payload.tag }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 5.0.0 - 2024-03-22

> [!WARNING]
>


## 3.0.1 - 2022-06-19
### Fixed
- Fixed type error when using field through GraphQL
Expand Down
18 changes: 17 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@
}
],
"require": {
"php": "8.2.0",
"craftcms/cms": "^5.0.0-alpha"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main"
},
"scripts": {
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix",
"phpstan": "phpstan --memory-limit=1G"
},
"autoload": {
"psr-4": {
"studioespresso\\daterange\\": "src/"
Expand All @@ -42,5 +52,11 @@
"type": "github",
"url": "https://github.com/sponsors/janhenckens"
}
]
],
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
}
}
Loading

0 comments on commit 5d7637e

Please sign in to comment.