Skip to content

Commit 90d42c1

Browse files
committed
Migrate from travis to GitHub Actions
1 parent 284fa24 commit 90d42c1

File tree

5 files changed

+58
-77
lines changed

5 files changed

+58
-77
lines changed

.github/workflows/test.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ARG PHP_VERSION=latest
2+
FROM php:${PHP_VERSION}-cli-alpine
3+
4+
WORKDIR /workdir
5+
6+
# install composer
7+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
8+
ENV COMPOSER_ALLOW_SUPERUSER=1
9+
ENV COMPOSER_HTACCESS_PROTECT=0
10+
ENV COMPOSER_CACHE_DIR=/.composer

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- '[0-9]+.x'
9+
10+
jobs:
11+
php:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- PHP_VERSION: 5.6
17+
- PHP_VERSION: 7.0
18+
- PHP_VERSION: 7.1
19+
- PHP_VERSION: 7.2
20+
- PHP_VERSION: 7.3
21+
- PHP_VERSION: 7.4
22+
- PHP_VERSION: 8.0
23+
- PHP_VERSION: 8.1
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Build Docker Image
29+
if: steps.cache-docker-image.outputs.cache-hit != 'true'
30+
run: docker build -f .github/workflows/test.Dockerfile -t 'test:${{ matrix.PHP_VERSION }}' --build-arg 'PHP_VERSION=${{ matrix.PHP_VERSION }}' .
31+
32+
- name: Cache Composer Cache Files
33+
uses: actions/cache@v2
34+
with:
35+
path: /tmp/composer-cache-files
36+
key: cache-composer-cache-files-${{ matrix.PHP_VERSION }}
37+
restore-keys: |
38+
cache-composer-cache-files-
39+
40+
- name: Install Composer Dependencies
41+
run: |
42+
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" -v '/tmp/composer-cache-files:/.composer' 'test:${{ matrix.PHP_VERSION }}' composer install --no-interaction --no-progress --prefer-dist ${{ matrix.COMPOSER_EXTRA_ARGS }}
43+
44+
- name: Run Unit Test
45+
run: |
46+
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit

.travis.yml

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

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# php-enum
2-
[![Build Status](https://secure.travis-ci.org/marc-mabe/php-enum.png?branch=master)](http://travis-ci.org/marc-mabe/php-enum)
3-
[![Quality Score](https://scrutinizer-ci.com/g/marc-mabe/php-enum/badges/quality-score.png?s=7dfddb19a12314ecc5f05eeb2b297bdde3ad2623)](https://scrutinizer-ci.com/g/marc-mabe/php-enum/)
4-
[![Code Coverage](https://scrutinizer-ci.com/g/marc-mabe/php-enum/badges/coverage.png?s=8442d532fad964fd3d8afe493ac2d0d65162306a)](https://scrutinizer-ci.com/g/marc-mabe/php-enum/)
2+
[![Build Status](https://github.com/marc-mabe/php-enum/workflows/Test/badge.svg?branch=3.x)](https://github.com/marc-mabe/php-enum/actions?query=workflow%3ATest%20branch%3A3.x)
53
[![Total Downloads](https://poser.pugx.org/marc-mabe/php-enum/downloads.png)](https://packagist.org/packages/marc-mabe/php-enum)
64
[![Latest Stable](https://poser.pugx.org/marc-mabe/php-enum/v/stable.png)](https://packagist.org/packages/marc-mabe/php-enum)
75

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"ext-reflection": "*"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^5.7 || ^6.0",
24+
"phpunit/phpunit": "^5.7 || ^6.0 || ^9.0",
2525
"phpbench/phpbench": "@dev",
2626

2727
"lstrojny/functional-php": "HHVM: variadic params with type constraints are not supported in non-Hack",

0 commit comments

Comments
 (0)