Add a GitHub workflow for the 3.x branch

This commit is contained in:
Ben Ramsey
2021-09-22 21:12:37 -05:00
parent be2451bef8
commit 323a608465
5 changed files with 115 additions and 7 deletions
@@ -0,0 +1,108 @@
# GitHub Actions Documentation: https://docs.github.com/en/actions
name: "build"
on: ["pull_request", "push"]
env:
COMPOSER_ROOT_VERSION: "1.99.99"
jobs:
coding-standards:
name: "Coding standards"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
extensions: bcmath, ctype, gmp, libsodium, uuid
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Check syntax (php-parallel-lint)"
run: "./vendor/bin/parallel-lint src tests --colors"
- name: "Check coding standards (PHP_CodeSniffer)"
run: "./vendor/bin/phpcs src tests --standard=psr2 -sp --colors"
code-coverage:
name: "Code coverage"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
extensions: bcmath, ctype, gmp, libsodium, uuid
coverage: "pcov"
ini-values: "memory_limit=-1"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Run unit tests (PHPUnit)"
run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml"
- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v1"
unit-tests:
name: "Unit Tests"
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-version:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
# Commenting out the following until I can work out a solution for the
# development libraries I use, since many of them or their dependencies
# do not support PHP 8.
#
# - "8.0"
# experimental:
# - false
# include:
# - php-version: "8.1"
# experimental: true
# composer-options: "--ignore-platform-req=php"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: bcmath, ctype, gmp, libsodium, uuid
coverage: "none"
ini-values: "memory_limit=-1"
- name: "Create the logs directory"
run: "mkdir -p build/logs"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
with:
composer-options: "${{ matrix.composer-options }}"
- name: "Run unit tests (PHPUnit)"
run: "./vendor/bin/phpunit --verbose --colors=always --no-coverage"
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2012-2020 Ben Ramsey <ben@benramsey.com>
Copyright (c) 2012-2021 Ben Ramsey <ben@benramsey.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+2 -2
View File
@@ -30,12 +30,12 @@
"codeception/aspect-mock": "^1 | ^2",
"doctrine/annotations": "^1.2",
"goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1",
"jakub-onderka/php-parallel-lint": "^1",
"mockery/mockery": "^0.9.11 | ^1",
"moontoast/math": "^1.1",
"paragonie/random-lib": "^2",
"php-mock/php-mock-phpunit": "^0.3 | ^1.1",
"phpunit/phpunit": "^4.8 | ^5.4 | ^6.5",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpunit/phpunit": ">=4.8.36",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
+2 -2
View File
@@ -2,15 +2,15 @@
namespace Ramsey\Uuid\Test\Builder;
use PHPUnit_Framework_TestCase;
use Ramsey\Uuid\Builder\DefaultUuidBuilder;
use Ramsey\Uuid\Test\TestCase;
/**
* Class DefaultUuidBuilderTest
* @package Ramsey\Uuid\Test\Builder
* @covers Ramsey\Uuid\Builder\DefaultUuidBuilder
*/
class DefaultUuidBuilderTest extends PHPUnit_Framework_TestCase
class DefaultUuidBuilderTest extends TestCase
{
public function testBuildCreatesUuid()
+2 -2
View File
@@ -2,15 +2,15 @@
namespace Ramsey\Uuid\Test\Builder;
use PHPUnit_Framework_TestCase;
use Ramsey\Uuid\Builder\DegradedUuidBuilder;
use Ramsey\Uuid\Test\TestCase;
/**
* Class DegradedUuidBuilderTest
* @package Ramsey\Uuid\Test\Builder
* @covers Ramsey\Uuid\Builder\DegradedUuidBuilder
*/
class DegradedUuidBuilderTest extends PHPUnit_Framework_TestCase
class DegradedUuidBuilderTest extends TestCase
{
public function testBuildCreatesUuid()