Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub Actions for CI #31

Merged
merged 1 commit into from
May 11, 2021
Merged
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
167 changes: 167 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Continuous Integration
on:
push:
branches:
- 'main'
- 'master'
- 'refs/heads/v[0-9]+.[0-9]+.[0-9]+'
pull_request:
jobs:
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
needs:
- lint-yaml
- lint-json
outputs:
version: ${{ steps.supported-versions-matrix.outputs.version }}
steps:
- uses: actions/checkout@v1
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1
composer-install:
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [current]
needs:
- lint-yaml
- lint-json
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'current'
- name: Install Dependencies
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'highest'
qa:
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (Linux)
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [current]
check: [unit]
needs:
- lint-yaml
- lint-json
- composer-install
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'current'
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'highest'
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
- run: ./vendor/bin/phpunit
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
unittests-directly-on-os:
name: Run unit tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [current]
needs:
- lint-yaml
- lint-json
- composer-install
- supported-versions-matrix
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug, pcov
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'current'
- name: Install Dependencies
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs
if: matrix.composer == 'highest'
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
- run: |
./vendor/bin/phpunit
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
lint-yaml:
name: Lint YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
ignore: |
/.git/
rules:
line-length: disable
document-start: disable
truthy: disable
lint-json:
name: Lint JSON
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
with:
pattern: "\\.json$"
check-mark:
name: ✔️
needs:
- lint-yaml
- lint-json
- qa
- unittests-directly-on-os
runs-on: ubuntu-latest
steps:
- run: echo "✔️"
68 changes: 0 additions & 68 deletions .scrutinizer.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cs-fix:
composer cs-fix

unit:
composer run-script unit --timeout=0
./vendor/bin/phpunit

unit-coverage:
composer run-script unit-coverage --timeout=0
Expand Down