Skip to content

Commit

Permalink
build on Github
Browse files Browse the repository at this point in the history
  • Loading branch information
mhujer committed Feb 28, 2021
1 parent 8279ef0 commit 1e6f91a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 19 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI build
on: [ push, pull_request ]
jobs:
build:
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} ${{ matrix.extra-label }} ${{ matrix.composer-dependencies }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.4', '8.0' ]
composer-dependencies: [ '', '--prefer-lowest' ]
composer-version: [ 'v1' ]
symfony-version: [ '' ]
extra-label: [ '' ]
include:
# Composer v2
- php-versions: '7.4'
operating-system: ubuntu-latest
composer-version: 'v2'
extra-label: 'Composer v2'

# Windows
- php-versions: '7.4'
operating-system: windows-latest
coverage: xdebug

# Windows
- php-versions: '8.0'
operating-system: windows-latest
coverage: xdebug

steps:
# see https://github.com/actions/checkout/issues/226#issue-606867805
- name: Prepare git
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
ini-values: memory_limit=-1
tools: composer:${{ matrix.composer-version }}
coverage: ${{ matrix.coverage }}

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

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-dependencies }}

- name: Run Build
run: composer run build

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls --no-progress --prefer-dist --optimize-autoloader
php-coveralls --coverage_clover=build/logs/clover.xml -v
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

0 comments on commit 1e6f91a

Please sign in to comment.