-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a dockerfile and workflow for ci via GitHub Actions
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |