Skip to content

Commit 05f9760

Browse files
committed
Switch from Travis to GitHub actions
1 parent ba885d3 commit 05f9760

File tree

6 files changed

+89
-51
lines changed

6 files changed

+89
-51
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.gitattributes export-ignore
2+
.github export-ignore
23
.gitignore export-ignore
34
/phpunit.xml.dist export-ignore
45
/tests export-ignore
5-
/.travis.yml export-ignore

.github/workflows/buildcheck.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
push:
3+
schedule:
4+
- cron: 0 10 13 * *
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php:
13+
- 7.2
14+
- 7.3
15+
- 7.4
16+
composer:
17+
- ""
18+
- "--prefer-lowest"
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Create Docker Container
24+
run: |
25+
docker build . -t ci-image --build-arg PHP_VERSION=${{ matrix.php }}
26+
docker run --interactive --detach --volume ${{ github.workspace }}:/app --name ci ci-image
27+
28+
- name: Install Dependencies
29+
run: docker exec ci composer update --no-interaction --no-ansi --prefer-dist ${{ matrix.composer }}
30+
31+
- name: PHPUnit
32+
run: docker exec ci vendor/bin/phpunit
33+
34+
- name: PHPStan
35+
run: |
36+
docker exec ci vendor/bin/phpstan analyse --level=max src
37+
docker exec ci vendor/bin/phpstan analyse --level=max --configuration=phpstan-tests.neon tests
38+
39+
- name: Coding Standards
40+
run: docker exec ci vendor/bin/phpcs --standard=phpcs.xml src tests
41+
42+
- name: Check Dependencies
43+
run: docker exec ci vendor/bin/composer-require-checker --config-file=.require.json
44+
45+
- name: Composer Validate
46+
run: docker exec ci composer validate --strict

.github/workflows/coverage.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on: push
2+
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Create Docker Container
11+
run: |
12+
docker build . -t ci-image --build-arg PHP_VERSION=7.4 --build-arg COVERAGE=pcov
13+
docker run --interactive --detach \
14+
--volume ${{ github.workspace }}:/app \
15+
--env CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} \
16+
--name ci ci-image
17+
18+
- name: Install Dependencies
19+
run: docker exec ci composer update --no-interaction --no-ansi --prefer-dist
20+
21+
- name: PHPUnit
22+
run: docker exec ci vendor/bin/phpunit --coverage-clover=coverage.xml
23+
24+
- name: Code Coverage
25+
run: docker exec ci bash -c "bash <(curl -s https://codecov.io/bash)"

.travis.yml

-49
This file was deleted.

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARG PHP_VERSION=7.2
2+
FROM php:${PHP_VERSION}-cli
3+
4+
RUN pecl install uopz && docker-php-ext-enable uopz
5+
RUN echo "uopz.exit=1" >> /usr/local/etc/php/conf.d/docker-php-ext-uopz.ini
6+
7+
ARG COVERAGE
8+
RUN if [ "$COVERAGE" = "pcov" ]; then pecl install pcov && docker-php-ext-enable pcov; fi
9+
10+
# Install composer to manage PHP dependencies
11+
RUN apt-get update && apt-get install -y git zip
12+
RUN curl https://getcomposer.org/download/1.10.13/composer.phar -o /usr/local/sbin/composer
13+
RUN chmod +x /usr/local/sbin/composer
14+
RUN composer self-update
15+
16+
WORKDIR /app

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Full documentation is available at http://duncan3dc.github.io/speaker/
55
PHPDoc API documentation is also available at [http://duncan3dc.github.io/speaker/api/](http://duncan3dc.github.io/speaker/api/namespaces/duncan3dc.Speaker.html)
66

77
[![release](https://poser.pugx.org/duncan3dc/speaker/version.svg)](https://packagist.org/packages/duncan3dc/speaker)
8-
[![build](https://travis-ci.org/duncan3dc/speaker.svg?branch=master)](https://travis-ci.org/duncan3dc/speaker)
8+
[![build](https://github.com/duncan3dc/speaker/workflows/.github/workflows/buildcheck.yml/badge.svg?branch=master)](https://github.com/duncan3dc/speaker/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fbuildcheck.yml)
99
[![coverage](https://codecov.io/gh/duncan3dc/speaker/graph/badge.svg)](https://codecov.io/gh/duncan3dc/speaker)
1010

1111
## Quick Example

0 commit comments

Comments
 (0)