Skip to content

Build

Build #100

Workflow file for this run

# This is the name of the workflow
name: Build
# This defines when the workflow will run
on:
# Scheduled to run weekly on Sundays at 02:00
schedule:
- cron: '0 2 * * 0'
# Triggers the workflow on push or pull request events for master and develop branches
push:
branches:
- master
pull_request:
branches:
- master
# This defines the jobs that will run in the workflow
jobs:
# This is the job for running the unit tests
phpunit:
# This defines the environment in which the job will run
runs-on: ubuntu-latest
steps:
# Step to set up Shopware
- name: Setup Shopware
uses: shopware/setup-shopware@main
with:
# Shopware version to use
shopware-version: 'v6.6.2.0'
# PHP version to use
php-version: 8.2
# Environment in which Shopware will run
env: test
# Required PHP extensions
php-extensions: pcov
# Install Shopware
install: true
# Step to check out the code
- name: Checkout MultiSafepay Shopware 6 module
uses: actions/checkout@v3
with:
# This needs to be placed in this location, so when addActivePlugins() in the
# custom ./tests/TestBootstrap.php is called, it will be able to find the plugin
# as this is the usual path for them
path: custom/plugins/MltisafeMultiSafepay
# Step to install the dependencies, matching the repository with the usual plugin location,
- name: Install Shopware 6 MultiSafepay module
run: |
composer config repositories.multisafepay.shopware6 "path" "custom/plugins/MltisafeMultiSafepay"
composer config allow-plugins.php-http/discovery false
composer require multisafepay/shopware6
bin/console plugin:refresh
bin/console plugin:install -c -a MltisafeMultiSafepay
# Run PHPUnit to execute the tests and generate a coverage report
- name: Run Tests
run: |
cd custom/plugins/MltisafeMultiSafepay/
php -d pcov.enabled=1 ../../../vendor/bin/phpunit --coverage-clover clover.xml
- name: Send clover to codecov
if: ${{ always() }}
working-directory: ./custom/plugins/MltisafeMultiSafepay
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -R .