From 7fad8512a1321f0df0c7b64a2659077c288552f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Hochd=C3=B6rfer?= Date: Sat, 23 Jan 2021 16:57:59 +0100 Subject: [PATCH] Add GitHub Action configuration --- .coveralls.yml | 3 ++ .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .coveralls.yml create mode 100644 .github/workflows/ci.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..0925971 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +coverage_clover: clover.xml +json_path: coveralls-upload.json + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..99e85f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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