Skip to content

Commit

Permalink
Create a dockerfile and workflow for ci via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
duncan3dc committed Aug 25, 2019
1 parent 8aa9dc3 commit d0b5183
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
push:
schedule:
- cron: 0 10 26 * *

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- 7.1
- 7.2
- 7.3
- 7.4-rc
composer:
- ""
- "--prefer-lowest"

steps:
- uses: actions/checkout@v1

- name: Create Docker Container
run: |
docker build . -t ci-image --build-arg PHP_VERSION=${{ matrix.php }}
docker run --interactive --detach --volume ${{ github.workspace }}:/app --name ci ci-image
- name: Install Dependencies
run: docker exec ci composer update --no-interaction --no-ansi --prefer-dist ${{ matrix.composer }}

- name: PHPUnit
run: docker exec ci vendor/bin/phpunit

- name: PHPStan
run: |
docker exec ci vendor/bin/phpstan analyse --level=max src
docker exec ci vendor/bin/phpstan analyse --level=max --configuration=phpstan-tests.neon tests
- name: Coding Standards
run: docker exec ci vendor/bin/phpcs --standard=PSR1,PSR2,PSR12 src tests

- name: Check Dependencies
run: docker exec ci vendor/bin/composer-require-checker

- name: Composer Validate
run: docker exec ci composer validate --strict
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG PHP_VERSION=7.1
FROM php:${PHP_VERSION}-cli

RUN apt-get update && apt-get install -y libxml2-dev && docker-php-ext-install soap
RUN docker-php-ext-install sockets

# Install composer to manage PHP dependencies
RUN apt-get update && apt-get install -y git zip
RUN curl https://getcomposer.org/download/1.9.0/composer.phar -o /usr/local/sbin/composer
RUN chmod +x /usr/local/sbin/composer
RUN composer self-update

WORKDIR /app

0 comments on commit d0b5183

Please sign in to comment.