Skip to content

Commit

Permalink
Add github actions, fix phpunit tests
Browse files Browse the repository at this point in the history
Also repacked the test p12 cert so it works with openssl3 in PHP 8.2, see https://www.php.net/manual/en/function.openssl-pkcs12-read.php#128992
  • Loading branch information
razvanphp committed Jan 10, 2024
1 parent 37157ec commit b3fa99b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 212 deletions.
32 changes: 0 additions & 32 deletions .circleci/config.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHPUnit

on: [push, pull_request]

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
name: PHPUnit w/ PHP ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
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

- name: Run PHPUnit
run: vendor/bin/phpunit --color=always
151 changes: 0 additions & 151 deletions .scrutinizer.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"email": "[email protected]"
}
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
"php": ">=7.4",
"ext-zip": "*",
Expand Down
29 changes: 14 additions & 15 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">

<phpunit bootstrap="vendor/autoload.php" colors="true">

<php>
<php>
<!--
<env name="P12_CERT_PATH" value="./../../cert/pass.com.example.testpass.p12" />
<env name="P12_CERT_PASS" value="123456" />
Expand All @@ -11,17 +10,17 @@
<env name="TEAM_ID" value="ABCDE12345" />
<env name="ORG_NAME" value="Organization Name" />
-->
</php>
</php>

<testsuites>
<testsuite name="PHP-Passbook Test Suite">
<directory>tests/Passbook/Tests/</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="PHP-Passbook Test Suite">
<directory>tests/Passbook/Tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src/Passbook/</directory>
</whitelist>
</filter>
</phpunit>
<coverage cacheDirectory=".cache/code-coverage" processUncoveredFiles="true">
<include>
<directory suffix=".php">src/Passbook/</directory>
</include>
</coverage>
</phpunit>
Binary file modified tests/cert/pass.com.example.testpass.p12
Binary file not shown.

0 comments on commit b3fa99b

Please sign in to comment.