Skip to content

Commit

Permalink
try github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Insolita committed Oct 24, 2020
1 parent 9c465cc commit 0d46f93
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: unused-scanner
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
name: unused-scanner (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0']

steps:
- uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}
- name: Install deps
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader

- name: Unit tests
run: php vendor/bin/phpunit

0 comments on commit 0d46f93

Please sign in to comment.