Skip to content

Commit

Permalink
Update dev toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed May 13, 2021
1 parent cc02f42 commit 3d7ad3d
Show file tree
Hide file tree
Showing 8 changed files with 2,625 additions and 644 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- 'app/**'
- 'tests/**'
- 'composer.**'
- 'phpstan*'
- '.github/workflows/analyze.yml'
push:
Expand All @@ -17,23 +18,30 @@ on:
paths:
- 'app/**'
- 'tests/**'
- 'composer.**'
- 'phpstan*'
- '.github/workflows/analyze.yml'

jobs:
build:
name: Analyze code
name: PHP ${{ matrix.php-versions }} Static Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4', '8.0']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: latest
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phpunit
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
Expand All @@ -59,10 +67,15 @@ jobs:
key: ${{ runner.os }}-phpstan-${{ github.sha }}
restore-keys: ${{ runner.os }}-phpstan-

- name: Install dependencies
- name: Install dependencies (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
# env:
# COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Install dependencies (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Run static analysis
run: vendor/bin/phpstan analyze
52 changes: 44 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:

jobs:
main:
name: Build and test
name: PHP ${{ matrix.php-versions }} Unit Tests

strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.3', '7.4', '8.0']

runs-on: ubuntu-latest

Expand All @@ -29,8 +29,10 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phpunit
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
Expand All @@ -43,12 +45,46 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
- name: Install dependencies (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
# To prevent rate limiting you may need to supply an OAuth token in Settings > Secrets
# env:
# https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens
# COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Install dependencies (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Enable Tachycardia
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV

- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --coverage-text
env:
TERM: xterm-256color

- if: matrix.php-versions == '8.0'
name: Mutate with Infection
run: |
composer global require infection/infection
git fetch --depth=1 origin $GITHUB_BASE_REF
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations
- if: matrix.php-versions == '8.0'
name: Run Coveralls
run: vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}

coveralls:
needs: [main]
name: Coveralls Finished
runs-on: ubuntu-latest
steps:
- name: Upload Coveralls results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
31 changes: 18 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Vagrantfile
writable/cache/*
!writable/cache/index.html

writable/files/*
!writable/files/index.html

writable/logs/*
!writable/logs/index.html

Expand All @@ -61,31 +64,30 @@ writable/uploads/*
!writable/uploads/index.html

writable/debugbar/*
writable/patches/*

writable/blog_visits.txt
writable/database.db

php_errors.log

#-------------------------
# User Guide Temp Files
#-------------------------
user_guide_src/build/*
user_guide_src/cilexer/build/*
user_guide_src/cilexer/dist/*
user_guide_src/cilexer/pycilexer.egg-info/*
public/error_log

#-------------------------
# Test Files
#-------------------------
tests/coverage*

# Don't save phpunit under version control.
results/
build/
phpunit*.xml
phpunit
.phpunit*.cache
app/Commands/Test.php

#-------------------------
# Composer
#-------------------------
vendor/
public/assets/vendor/

#-------------------------
# IDE / Development Files
Expand Down Expand Up @@ -123,7 +125,10 @@ nb-configuration.xml
# Visual Studio Code
.vscode/

/results/
/phpunit*.xml
/*.cache
#-------------------------
# Local & Sensitive Files
#-------------------------

/access
/local
/public/local
98 changes: 59 additions & 39 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,64 @@
{
"name": "codeigniter4projects/website",
"type": "project",
"description": "CodeIgniter Website",
"homepage": "https://codeigniter.com",
"license": "MIT",
"require": {
"php": ">=7.2",
"codeigniter4/codeigniter4": "dev-develop",
"knplabs/github-api": "~1.7.1",
"league/commonmark": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"phpstan/phpstan": "^0.12",
"fzaninotto/faker": "^1.9@dev",
"mikey179/vfsstream": "^1.6",
"name": "codeigniter4projects/website",
"type": "project",
"description": "CodeIgniter Website",
"keywords": [
"codeigniter",
"codeigniter4"
],
"homepage": "https://codeigniter.com",
"license": "MIT",
"authors": [
{
"name": "CodeIgniter Foundation",
"email": "[email protected]",
"homepage": "https://codeigniter.com",
"role": "Owner"
}
],
"require": {
"php": "^7.3 || ^8.0",
"codeigniter4/codeigniter4": "dev-develop",
"knplabs/github-api": "~1.7.1",
"league/commonmark": "^1.5"
},
"require-dev": {
"codeigniter4/codeigniter4-standard": "^1.0",
"fakerphp/faker": "^1.9@dev",
"mikey179/vfsstream": "^1.6",
"nexusphp/tachycardia": "^1.0",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"scripts": {
},
"autoload": {
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/codeigniter4"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 src/ tests/",
"test": "phpunit"
},
"support": {
"forum": "http://forum.codeigniter.com/",
"source": "https://github.com/codeigniter4/CodeIgniter4",
"slack": "https://codeigniterchat.slack.com"
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/codeigniter4"
}
]
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ app/",
"test": "phpunit"
},
"support": {
"forum": "http://forum.codeigniter.com/",
"source": "https://github.com/codeigniter4/CodeIgniter4",
"slack": "https://codeigniterchat.slack.com"
}
}
Loading

0 comments on commit 3d7ad3d

Please sign in to comment.