This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (79 loc) · 3.49 KB
/
rector-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Rector"
on: # yamllint disable-line rule:truthy
push:
paths:
- "**.php"
- "composer.json"
pull_request:
paths:
- "**.php"
- "composer.json"
jobs:
rector-ci:
name: "Rector"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: ["8.0"]
dependencies: ["locked"]
env:
key: "rector-ci-v1" # change key (version) to clear cache
extensions: "mbstring, intl"
ini-values: "date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
tools: "composer:v2, cs2pr"
steps:
- name: "Git checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
- name: "Setup cache environment"
id: "cache-env"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-versions }}"
extensions: "${{ env.extensions }}"
key: "${{ env.key }}"
- name: "Cache extensions"
uses: "actions/cache@v2"
with:
path: "${{ steps.cache-env.outputs.dir }}"
key: "${{ steps.cache-env.outputs.key }}"
restore-keys: "${{ steps.cache-env.outputs.key }}"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-versions }}"
extensions: "${{ env.extensions }}"
ini-values: "${{ env.ini-values }}"
tools: "${{ env.tools }}"
coverage: "pcov"
- name: "Setup Problem Matchers for PHP"
run: "echo '::add-matcher::${{ runner.tool_cache }}/php.json'"
- name: "Check PHP Version"
run: "php -v"
- name: "List all php extensions with versions"
run: "php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . \" \" . phpversion($extension) . PHP_EOL;'"
- name: "Configure Container"
env:
GIT_USER_EMAIL: "${{ secrets.GIT_USER_EMAIL }}"
GIT_USER_USERNAME: "${{ secrets.GIT_USER_USERNAME }}"
run: |
EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
git config --global user.email "${EMAIL}"
git config --global user.name "${NAME}"
- name: "Check Composer Version"
run: "composer -V"
- name: "Validate composer.json and composer.json"
run: "composer validate --strict"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Rector lint"
run: "composer rector -- --no-progress-bar"