Skip to content

Commit

Permalink
Attempt to use github CI (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
BackEndTea authored Jan 18, 2021
1 parent 088006b commit 0cb5813
Show file tree
Hide file tree
Showing 8 changed files with 992 additions and 326 deletions.
160 changes: 160 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# https://docs.github.com/en/actions

name: "CI"

on:
pull_request: ~
push:
branches:
- "master"

env:
COMPOSER_ROOT_VERSION: 1.99

jobs:
coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@2.9.0"
with:
coverage: "none"
extensions: "mbstring"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"


- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress"

static-code-analysis:
name: "Static Code Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@2.9.0"
with:
coverage: "none"
extensions: "mbstring"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress && composer i --working-dir=ci"

- name: "Run vimeo/psalm"
run: "ci/vendor/bin/psalm --threads=4"

tests:
name: "Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@2.9.0"
with:
coverage: "none"
extensions: "mbstring"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress"

- name: "Run unit tests"
run: "vendor/bin/phpunit"

windows-tests:
name: "Windows tests"

runs-on: "windows-latest"

strategy:
matrix:
php-version:
- "7.4"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@2.9.0"
with:
coverage: "none"
extensions: "mbstring"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress"

- name: "Run unit tests"
run: "vendor/bin/phpunit tests/AssertTest.php"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.3.4"
- name: "Install PHP"
uses: "shivammathur/setup-php@2.9.0"
with:
coverage: "pcov"
extensions: "mbstring"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress"

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

- name: "Upload coverage"
run: "wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
/composer.lock
.phpunit.result.cache
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

34 changes: 0 additions & 34 deletions appveyor.yml

This file was deleted.

Loading

0 comments on commit 0cb5813

Please sign in to comment.