Skip to content

Commit

Permalink
Run unit tests using GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sobak committed Jan 16, 2024
1 parent daaf20c commit 1d87881
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests

on:
push:
paths-ignore:
- 'Docs/**'
pull_request:
paths-ignore:
- 'Docs/**'

jobs:
tests:
strategy:
fail-fast: true
matrix:
php: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]

name: "PHP ${{ matrix.php }}"

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- name: Get Composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: PHPUnit
run: php bin/phpunit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![Logo](https://keylighter.kadet.net/img/logo.png)

[![Packagist](https://img.shields.io/packagist/v/kadet/keylighter.svg?style=flat-square)](https://packagist.org/packages/kadet/keylighter)
[![GitHub Actions](https://github.com/kadet1090/keylighter/actions/workflows/tests.yml/badge.svg?event=push)](https://github.com/kadet1090/KeyLighter/actions)
[![Try it](https://img.shields.io/badge/www-try%20it-FF9700.svg?style=flat-square)](https://keylighter.kadet.net)

[![stability: stable](https://img.shields.io/badge/Public%20API-stable-green.svg?style=flat-square)](Docs/2-basic-usage.md)
Expand Down

0 comments on commit 1d87881

Please sign in to comment.