Skip to content

feat: add types

feat: add types #45

Workflow file for this run

name: Tests
on:
workflow_dispatch:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
ext: ['curl, mbstring, openssl', 'curl, mbstring, openssl, gmp']
name: PHP ${{ matrix.php }} (${{ matrix.ext }})
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php }} (${{ matrix.ext }})
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.ext }}
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
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
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install web-push-testing server
run: |
npm install -g web-push-testing
- name: Run unit tests
run: |
web-push-testing --port 9012 start
composer test:unit
web-push-testing --port 9012 stop
- name: Run PHPStan
run: composer test:typing
- name: Run php-cs-fixer
run: |
composer test:syntax
composer test:syntax_tests