Set up GitHub Actions

This commit is contained in:
Andrey Savchenko committed 2022-06-09 14:56:21 +03:00
1 parent 430919bcdf
commit beeff70d98
4 files changed
+64 -22

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
tools: phpunit:9,psalm
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- run: composer install --no-interaction
- name: Psalm
run: psalm --output-format=github
if: always()
- name: PHPUnit
run: phpunit --coverage-text
if: always()
+4 -6
View File
@@ -4,9 +4,7 @@
_Make a site, make it fast._ _Make a site, make it fast._
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Rarst/laps/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master) [![Tests Status](https://github.com/rarst/laps/actions/workflows/tests.yml/badge.svg)](https://github.com/Rarst/laps/actions/workflows/tests.yml)
[![Build Status](https://scrutinizer-ci.com/g/Rarst/laps/badges/build.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/build-status/master)
[![Code Coverage](https://scrutinizer-ci.com/g/Rarst/laps/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master)
[![Total Downloads](https://img.shields.io/packagist/dt/rarst/laps.svg)](https://packagist.org/packages/rarst/laps) [![Total Downloads](https://img.shields.io/packagist/dt/rarst/laps.svg)](https://packagist.org/packages/rarst/laps)
[![Latest Stable Version](https://img.shields.io/packagist/v/rarst/laps.svg?label=version)](https://packagist.org/packages/rarst/laps) [![Latest Stable Version](https://img.shields.io/packagist/v/rarst/laps.svg?label=version)](https://packagist.org/packages/rarst/laps)
[![PHP from Packagist](https://img.shields.io/packagist/php-v/rarst/laps.svg)](https://packagist.org/packages/rarst/laps) [![PHP from Packagist](https://img.shields.io/packagist/php-v/rarst/laps.svg)](https://packagist.org/packages/rarst/laps)
@@ -37,9 +35,9 @@ API requests need to be authenticated as admin for performance data to be sent.
## Installation ## Installation
| [Composer](https://getcomposer.org/) (recommended) | Release archive | | [Composer](https://getcomposer.org/) (recommended) | Release archive |
| -------------------------------------------------- | -------- | | -------------------------------------------------- | -------- |
| `composer require rarst/laps` | [![Download Laps](https://img.shields.io/badge/download-laps.zip-blue?style=for-the-badge)](https://github.com/Rarst/laps/releases/latest/download/laps.zip) | | `composer require rarst/laps` | [![Download Laps](https://img.shields.io/badge/download-laps.zip-blue?style=for-the-badge)](https://github.com/Rarst/laps/releases/latest/download/laps.zip)|
## Tests ## Tests
+16 -15
View File
@@ -1,15 +1,16 @@
<phpunit bootstrap="vendor/autoload.php"> <?xml version="1.0"?>
<testsuites> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<testsuite name="Laps"> <coverage processUncoveredFiles="true">
<directory>tests</directory> <include>
</testsuite> <directory suffix=".php">src</directory>
</testsuites> </include>
<filter> <exclude>
<whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">src/mustache/cache</directory>
<directory suffix=".php">src</directory> </exclude>
<exclude> </coverage>
<directory suffix=".php">src/mustache/cache</directory> <testsuites>
</exclude> <testsuite name="Laps">
</whitelist> <directory>tests</directory>
</filter> </testsuite>
</phpunit> </testsuites>
</phpunit>
+1 -1
View File
@@ -1,9 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<psalm <psalm
totallyTyped="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config" xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="2"
> >
<projectFiles> <projectFiles>
<directory name="src"/> <directory name="src"/>