Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Migrate to GitHub actions
Browse files Browse the repository at this point in the history
Travis-CI no longer works
  • Loading branch information
mdio committed Jul 4, 2022
1 parent 590dd90 commit 23a001a
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 104 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
uses: php-actions/composer@v6
with:
version: 2
php_version: ${{ matrix.php-versions }}

- name: Run test suite
run: vendor/bin/phpunit
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ composer-update:
phpunit:
@mkdir -p build/tmp build/share/test/schemas build/build/interop/data
@chmod -R a+w build
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpunit --coverage-text test/AllTests.php
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpunit --coverage-text

run:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(ARGS)
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.com/researchgate/avro-php.svg?branch=master)](https://travis-ci.com/researchgate/avro-php)
![Test status](https://github.com/researchgate/phpnsc/actions/workflows/tests.yml/badge.svg)

What the Avro PHP library is
============================
Expand All @@ -11,13 +11,10 @@ Requirements
* On 32-bit platforms, the [GMP PHP extension](http://php.net/gmp)
* For testing, [PHPUnit](http://www.phpunit.de/)

Both GMP and PHPUnit are often available via package management
systems as `php5-gmp` and `phpunit`, respectively.

Getting started
===============

Untar the avro-php distribution, untar it, and put it in your include path:
Untar the avro-php distribution and put it in your include path:

tar xjf avro-php.tar.bz2 # avro-php.tar.bz2 is likely avro-php-1.4.0.tar.bz2
cp avro-php /path/to/where/you/want/it
Expand Down
20 changes: 20 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="test/test_helper.php"
backupGlobals="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite name="default">
<directory suffix="Test.php">test</directory>
</testsuite>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">lib</directory>
</whitelist>
</filter>
</phpunit>
15 changes: 0 additions & 15 deletions phpunit.xml.dist

This file was deleted.

55 changes: 0 additions & 55 deletions test/AllTests.php

This file was deleted.

10 changes: 10 additions & 0 deletions test/test_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
define('AVRO_TEST_SCHEMAS_DIR', implode(DIRECTORY_SEPARATOR, array(AVRO_SHARE_DIR, 'test', 'schemas')));
define('AVRO_INTEROP_SCHEMA', implode(DIRECTORY_SEPARATOR, array(AVRO_TEST_SCHEMAS_DIR, 'interop.avsc')));

if (!file_exists(TEST_TEMP_DIR)) {
mkdir(TEST_TEMP_DIR, 0777, true);
}
if (!file_exists(AVRO_TEST_SCHEMAS_DIR)) {
mkdir(AVRO_TEST_SCHEMAS_DIR, 0777, true);
}
if (!file_exists(AVRO_BUILD_DATA_DIR)) {
mkdir(AVRO_BUILD_DATA_DIR, 0777, true);
}

$tz = ini_get('date.timezone');
if (empty($tz)) {
date_default_timezone_set('UTC');
Expand Down

0 comments on commit 23a001a

Please sign in to comment.