Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Sep 11, 2020
0 parents commit bce23be
Show file tree
Hide file tree
Showing 24 changed files with 632 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
37 changes: 37 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Autodetect text files
* text=auto

# ...Unless the name matches the following overriding patterns

# Definitively text files
*.php text
*.css text
*.js text
*.txt text
*.md text
*.xml text
*.json text
*.bat text
*.sql text
*.yml text

# Ensure those won't be messed up with
*.png binary
*.jpg binary
*.gif binary
*.ttf binary

# Ignore some meta files when creating an archive of this repository
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore

# Avoid merge conflicts in CHANGELOG
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
/CHANGELOG.md merge=union

67 changes: 67 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Yii Contributor Code of Conduct

## Our Pledge

As contributors and maintainers of this project, and in order to keep Yii community open and welcoming, we ask to respect all community members.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Personal attacks
* Trolling or insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other conduct which could reasonably be considered inappropriate in
a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in response
to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when
an individual is representing the project or its community. Examples of representing
a project or community include posting via an official social media account,
within project GitHub, official forum or acting as an appointed representative at
an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
by contacting core team members. All complaints will be reviewed and investigated
and will result in a response that is deemed necessary and appropriate to the circumstances.
The project team is obligated to maintain confidentiality with regard to the reporter of
an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith
may face temporary or permanent repercussions as determined by other members of
the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4.0, available at
[http:https://contributor-covenant.org/version/1/4/][version]

[homepage]: http:https://contributor-covenant.org
[version]: http:https://contributor-covenant.org/version/1/4/
23 changes: 23 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Prerequisites

- [Yii goal and values](https://github.com/yiisoft/docs/blob/master/001-yii-values.md)
- [Namespaces](https://github.com/yiisoft/docs/blob/master/004-namespaces.md)
- [Git commit messages](https://github.com/yiisoft/docs/blob/master/006-git-commit-messages.md)
- [Exceptions](https://github.com/yiisoft/docs/blob/master/007-exceptions.md)
- [Interfaces](https://github.com/yiisoft/docs/blob/master/008-interfaces.md)

# Getting started

Since Yii 3 consists of many packages, we have a [special development tool](https://github.com/yiisoft/docs/blob/master/005-development-tool.md).

1. [Clone the repository](https://github.com/yiisoft/yii-dev-tool).

2. [Set up your own fork](https://github.com/yiisoft/yii-dev-tool#using-your-own-fork).

3. Now you are ready. Fork any package listed in `packages.php` and do `./yii-dev install username/package`.

If you don't have any particular package in mind to start with:

- [Check roadmap](https://github.com/yiisoft/docs/blob/master/003-roadmap.md).
- Check package issues at github. Usually there are some.
- Ask @samdark.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

open_collective: yiisoft
github: [yiisoft]
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


### What steps will reproduce the problem?

### What is the expected result?

### What do you get instead?


### Additional info

| Q | A
| ---------------- | ---
| Version | 1.0.?
| PHP version |
| Operating system |
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
| Q | A
| ------------- | ---
| Is bugfix? | ✔️/❌
| New feature? | ✔️/❌
| Breaks BC? | ✔️/❌
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
6 changes: 6 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Security Policy

Please use the [security issue form](https://www.yiiframework.com/security) to report to us any security issue you
find in Yii. DO NOT use the issue tracker or discuss it in the public forum as it will cause more damage than help.

Please note that as a non-commercial OpenSource project we are not able to pay bounties at the moment.
15 changes: 15 additions & 0 deletions .github/workflows/bc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
- pull_request
- push

name: backwards compatibility
jobs:
roave_bc_check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Roave BC Check
uses: docker:https://nyholm/roave-bc-check-ga
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
on:
- pull_request
- push

name: build

jobs:
tests:
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
env:
extensions: curl, mbstring, dom, intl, json, libxml, xml, xmlwriter
key: cache-v1

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

php-version:
- "7.4"
- "8.0"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- 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 }}

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2

- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"

- name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest'
run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer"

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install dependencies with composer php 7.4
if: matrix.php-version == '7.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Install dependencies with composer php 8.0
if: matrix.php-version == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Run tests with phpunit and coverage on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
run: vendor/bin/phpunit --coverage-clover=coverage.clover

- name: Run tests with phpunit without coverage
if: matrix.os != 'ubuntu-latest' || matrix.php-version != '7.4'
run: vendor/bin/phpunit

- name: Upload code coverage scrutinizer on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
55 changes: 55 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
pull_request:
push:
branches:
- "master"

name: mutation test

jobs:
mutation:
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
coverage: "pcov"
tools: composer:v2

- name: Determine composer cache directory
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Run test mutation infection with coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-xml=build/logs/coverage-xml --log-junit=build/logs/junit.xml
vendor/bin/infection --threads=2 --coverage=build/logs --show-mutations --no-progress --min-msi=10 --min-covered-msi=10
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
50 changes: 50 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
- pull_request
- push

name: static analysis

jobs:
mutation:
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
env:
extensions: ast

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: ${{ env.extensions }}
tools: composer:v2, cs2pr
coverage: none

- name: Determine composer cache directory
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Static analysis with psalm
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
Loading

0 comments on commit bce23be

Please sign in to comment.