Skip to content

Commit d25e08f

Browse files
committed
Move PHP-CS-Fixer and PHPStan jobs to GitHub Actions
Goodbye, CircleCI!
1 parent 40ae741 commit d25e08f

File tree

5 files changed

+123
-232
lines changed

5 files changed

+123
-232
lines changed

.circleci/config.yml

-226
This file was deleted.

.editorconfig

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ indent_style = space
4343
indent_size = 4
4444
trim_trailing_whitespace = false
4545

46-
[.circleci/config.yml]
47-
indent_style = space
48-
indent_size = 2
49-
5046
[.github/workflows/*.yml]
5147
indent_style = space
5248
indent_size = 2

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/.circleci export-ignore
21
/.editorconfig export-ignore
32
/.gitattributes export-ignore
43
/.github export-ignore

.github/workflows/ci.yml

+123
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,129 @@ env:
1212
EXT_PCOV_VERSION: '1.0.6'
1313

1414
jobs:
15+
php-cs-fixer:
16+
name: PHP-CS-Fixer (PHP ${{ matrix.php }})
17+
runs-on: ubuntu-latest
18+
container:
19+
image: php:${{ matrix.php }}-alpine
20+
options: >-
21+
--tmpfs /tmp:exec
22+
--tmpfs /var/tmp:exec
23+
strategy:
24+
matrix:
25+
php:
26+
- '7.4'
27+
fail-fast: false
28+
timeout-minutes: 5
29+
env:
30+
PHP_CS_FIXER_FUTURE_MODE: '1'
31+
PHP_CS_FIXER_VERSION: '^2.14'
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v1
35+
- name: Install system packages
36+
run: |
37+
apk add \
38+
unzip \
39+
- name: Disable PHP memory limit
40+
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
41+
- name: Install Composer
42+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
43+
- name: Cache Composer packages
44+
uses: actions/cache@v1
45+
with:
46+
path: ~/.composer/cache
47+
key: composer-php${{ matrix.php }}-php-cs-fixer-${{ github.sha }}
48+
restore-keys: |
49+
composer-php${{ matrix.php }}-php-cs-fixer-
50+
composer-php${{ matrix.php }}-
51+
composer-
52+
continue-on-error: true
53+
- name: Install Symfony Flex
54+
run: |
55+
composer global require --prefer-dist --no-progress --no-suggest --ansi \
56+
symfony/flex
57+
- name: Install PHP-CS-Fixer
58+
run: |
59+
composer global require --prefer-dist --no-progress --no-suggest --ansi \
60+
friendsofphp/php-cs-fixer:"${PHP_CS_FIXER_VERSION}"
61+
- name: Cache PHP-CS-Fixer results
62+
uses: actions/cache@v1
63+
with:
64+
path: /var/cache/php-cs-fixer
65+
key: php-cs-fixer-php${{ matrix.php }}-${{ github.sha }}
66+
restore-keys: |
67+
php-cs-fixer-php${{ matrix.php }}-
68+
php-cs-fixer-
69+
continue-on-error: true
70+
- name: Run PHP-CS-Fixer fix
71+
run: |
72+
export PATH="$PATH:$HOME/.composer/vendor/bin"
73+
mkdir -p /var/cache/php-cs-fixer
74+
php-cs-fixer fix --dry-run --diff --cache-file=/var/cache/php-cs-fixer/.php_cs.cache --ansi
75+
76+
phpstan:
77+
name: PHPStan (PHP ${{ matrix.php }})
78+
runs-on: ubuntu-latest
79+
container:
80+
image: php:${{ matrix.php }}-alpine
81+
options: >-
82+
--tmpfs /tmp:exec
83+
--tmpfs /var/tmp:exec
84+
strategy:
85+
matrix:
86+
php:
87+
- '7.4'
88+
fail-fast: false
89+
timeout-minutes: 5
90+
env:
91+
APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v1
95+
- name: Install system packages
96+
run: |
97+
apk add \
98+
unzip \
99+
- name: Disable PHP memory limit
100+
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
101+
- name: Install Composer
102+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
103+
- name: Cache Composer packages
104+
uses: actions/cache@v1
105+
with:
106+
path: ~/.composer/cache
107+
key: composer-php${{ matrix.php }}-${{ github.sha }}
108+
restore-keys: |
109+
composer-php${{ matrix.php }}-
110+
composer-
111+
continue-on-error: true
112+
- name: Install Symfony Flex
113+
run: |
114+
composer global require --prefer-dist --no-progress --no-suggest --ansi \
115+
symfony/flex
116+
- name: Update project dependencies
117+
run: |
118+
mkdir -p /tmp/api-platform/core/vendor
119+
ln -s /tmp/api-platform/core/vendor vendor
120+
composer update --no-progress --no-suggest --ansi
121+
- name: Clear test app cache
122+
run: |
123+
mkdir -p /tmp/api-platform/core/var
124+
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
125+
tests/Fixtures/app/console cache:clear --ansi
126+
- name: Cache PHPStan results
127+
uses: actions/cache@v1
128+
with:
129+
path: /tmp/phpstan
130+
key: phpstan-php${{ matrix.php }}-${{ github.sha }}
131+
restore-keys: |
132+
phpstan-php${{ matrix.php }}-
133+
phpstan-
134+
continue-on-error: true
135+
- name: Run PHPStan analysis
136+
run: vendor/bin/phpstan analyse --ansi
137+
15138
phpunit:
16139
name: PHPUnit (PHP ${{ matrix.php }})
17140
runs-on: ubuntu-latest

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Build a working and fully-featured CRUD API in minutes. Leverage the awesome fea
1010
high performance API-first projects. Extend or override everything you want.
1111

1212
[![GitHub Actions](https://github.com/api-platform/core/workflows/CI/badge.svg?branch=master)](https://github.com/api-platform/core/actions?query=workflow%3ACI+branch%3Amaster)
13-
[![CircleCI](https://circleci.com/gh/api-platform/core/tree/master.svg?style=shield)](https://circleci.com/gh/api-platform/core/tree/master)
1413
[![AppVeyor](https://ci.appveyor.com/api/projects/status/grwuyprts3wdqx5l/branch/master?svg=true)](https://ci.appveyor.com/project/dunglas/dunglasapibundle/branch/master)
1514
[![Codecov](https://codecov.io/gh/api-platform/core/branch/master/graph/badge.svg)](https://codecov.io/gh/api-platform/core/branch/master)
1615
[![SymfonyInsight](https://insight.symfony.com/projects/92d78899-946c-4282-89a3-ac92344f9a93/mini.svg)](https://insight.symfony.com/projects/92d78899-946c-4282-89a3-ac92344f9a93)

0 commit comments

Comments
 (0)