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

Add CI test workflow #5

Closed
wants to merge 4 commits into from
Closed
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
29 changes: 29 additions & 0 deletions .github/workflows/ciUnitTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ciUnitTests
on:
pull_request:
branches:
- 'main'

jobs:
integration:
name: CI Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Install composer requirements.
run: |
composer require --dev phpunit/phpunit
composer require leuchtfeuer/mautic-companysegments-bundle leuchtfeuer/mautic-companytags-bundle
composer install
- name: Run PHPUnit
run: ./vendor/bin/phpunit --testsuite unit --coverage-cobertura=coverage.xml





9 changes: 9 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
include_once __DIR__.'/../../../../vendor/autoload.php';
} else {
include_once __DIR__.'/../vendor/autoload.php';
}
33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,38 @@
"minimum-stability": "dev",
"require": {
"mautic/core-lib": "^5.0"
},
"autoload": {
"psr-4": {
"MauticPlugin\\LeuchtfeuerCompanyPointsBundle\\" : ""
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/mautic/FOSOAuthServerBundle.git"
},
{
"type": "git",
"url": "https://github.com/mautic/SpBundle.git"
},
{
"type": "git",
"url": "https://github.com/mautic/SymfonyBridgeBundle.git"
},
{
"type": "vcs",
"url": "https://github.com/Leuchtfeuer/mautic-CompanyTags-bundle.git"
},
{
"type": "vcs",
"url": "https://github.com/Leuchtfeuer/mautic-CompanySegments-bundle.git"
}
],
"config": {
"allow-plugins": {
"symfony/flex": true,
"php-http/discovery": false
}
}
}
25 changes: 25 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"
bootstrap="Tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>*</directory>
</include>
<exclude>
<directory>Config</directory>
<directory>Tests</directory>
<directory>vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="unit">
<directory>Tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<server name="KERNEL_DIR" value="../../app"/>
<env name="KERNEL_CLASS" value="AppKernel"/>
<ini name="error_reporting" value="E_ALL" />
</php>
</phpunit>
Loading