Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Add GitHub Action configuration #16

Merged
merged 1 commit into from
Jan 23, 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
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json

61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: ci
on: [push, pull_request]

jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4']
coveralls: [false]
include:
- operating-system: 'ubuntu-latest'
php-versions: '7.4'
coveralls: true
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v1
coverage: xdebug

- name: Install Composer dependencies
run: composer install

- name: Linting code
run: ./vendor/bin/phing lint

- name: Codesniffer
run: ./vendor/bin/phing sniff

- name: Static code analysis
run: ./vendor/bin/phing analyse

- name: Magerun
if: matrix.coveralls == false
run: |
wget https://files.magerun.net/n98-magerun2-latest.phar
mkdir -p ~/.n98-magerun2/modules
ln -s $(pwd) ~/.n98-magerun2/modules/magerun2-list-api-endpoints
php n98-magerun2-latest.phar help api:list:endpoints

- name: Unittests
if: matrix.coveralls == false
run: ./vendor/bin/phing unit

- name: Unittests with coverage
if: matrix.coveralls == true
run: ./vendor/bin/phing unit-with-coverage

- name: Coveralls report
if: matrix.coveralls == true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer require php-coveralls/php-coveralls
./vendor/bin/php-coveralls --coverage_clover=clover.xml -v