Skip to content

Commit 31c4588

Browse files
authored
Update tests (#74)
* chore: migrate CI from Travis/ORCA to GitHub Actions Travis CI has been unused for this project for years and the "ORCA CI" workflow was really just a Travis translation, carrying an obsolete PHP 7.3/8.0 and Symfony 4.4/5.3 matrix. Replace both with a single .github/workflows/tests.yml: - Triggers on push and pull_request. - Matrix over PHP 7.4 (the composer.json floor), 8.4 (current) and 8.5 (next, non-blocking via continue-on-error while tooling catches up). - Validates composer.json, installs dependencies and runs the native PHPUnit suite directly rather than going through make/ORCA. - Coding standards (php-cs-fixer, phpmd) run once in a separate job on the current PHP version. Also swap the Travis badge in README.md for the Actions badge and ignore the modern .php-cs-fixer.cache filename. * chore: pin the Tests badge to master and document the experimental PHP slot The badge now reports the default branch explicitly rather than whichever branch ran most recently. The non-blocking PHP 8.5 job is a permanent slot for the next PHP release, not a temporary hedge, so keep continue-on-error in place and promote the version through the matrix as releases land. --------- Co-authored-by: Jakob Perry <japerry@users.noreply.github.com>
1 parent 1e18305 commit 31c4588

5 files changed

Lines changed: 80 additions & 100 deletions

File tree

.github/workflows/orca.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
tests:
12+
name: PHP ${{ matrix.php-version }}
13+
runs-on: ubuntu-latest
14+
continue-on-error: ${{ matrix.experimental }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
# Earliest supported PHP version (see "php" in composer.json).
20+
- php-version: "7.4"
21+
experimental: false
22+
# Current PHP version.
23+
- php-version: "8.4"
24+
experimental: false
25+
# Next PHP version. This slot is always non-blocking by design: it
26+
# gives early warning about the upcoming release without failing the
27+
# build over tooling that has not caught up yet. When 8.5 becomes
28+
# current, promote it and open a new experimental slot for 8.6.
29+
- php-version: "8.5"
30+
experimental: true
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php-version }}
39+
coverage: none
40+
tools: composer:v2
41+
42+
- name: Validate composer.json
43+
run: composer validate --strict
44+
45+
- name: Cache Composer packages
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.cache/composer/files
49+
key: composer-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}
50+
restore-keys: composer-${{ matrix.php-version }}-
51+
52+
- name: Install dependencies
53+
run: composer install --prefer-dist --no-progress
54+
55+
- name: PHPUnit
56+
run: vendor/bin/phpunit
57+
58+
lint:
59+
name: Coding standards
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Setup PHP
65+
uses: shivammathur/setup-php@v2
66+
with:
67+
php-version: "8.4"
68+
coverage: none
69+
tools: composer:v2
70+
71+
- name: Install dependencies
72+
run: composer install --prefer-dist --no-progress
73+
74+
- name: PHP-CS-Fixer
75+
run: vendor/bin/php-cs-fixer fix --dry-run --diff -v
76+
77+
- name: PHPMD
78+
run: vendor/bin/phpmd src/,test/ text ./phpmd.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ composer.lock
1818
# Ignore PHP-CS-Fixer files
1919
/.php_cs
2020
/.php_cs.cache
21+
/.php-cs-fixer.cache
2122
/cs_fixer_tmp_*

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HTTP HMAC Signer for PHP
22

3-
[![Build Status](https://travis-ci.org/acquia/http-hmac-php.svg)](https://travis-ci.org/acquia/http-hmac-php)
3+
[![Tests](https://github.com/acquia/http-hmac-php/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/acquia/http-hmac-php/actions/workflows/tests.yml)
44
[![Total Downloads](https://poser.pugx.org/acquia/http-hmac-php/downloads)](https://packagist.org/packages/acquia/http-hmac-php)
55
[![Latest Stable Version](https://poser.pugx.org/acquia/http-hmac-php/v/stable.svg)](https://packagist.org/packages/acquia/http-hmac-php)
66
[![License](https://poser.pugx.org/acquia/http-hmac-php/license.svg)](https://packagist.org/packages/acquia/http-hmac-php)

0 commit comments

Comments
 (0)