Skip to content

Commit ef9f881

Browse files
committed
Update(github) Update github workflows, include cache for composer install
1 parent 3c59273 commit ef9f881

File tree

3 files changed

+66
-51
lines changed

3 files changed

+66
-51
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ insert_final_newline = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
13+
14+
[.github/**.yml]
15+
indent_size = 2
16+
indent_style = space
Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,60 @@
11
name: "Continuous Integration"
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
88

99
env:
10-
fail-fast: true
10+
fail-fast: true
1111

1212
jobs:
13-
tests:
14-
name: "Symfony1 Tests"
15-
runs-on: "ubuntu-22.04"
16-
17-
strategy:
18-
matrix:
19-
php-version:
20-
- "7.4"
21-
- "8.0"
22-
- "8.1"
23-
- "8.2"
24-
memcached-version:
25-
- "1.6"
26-
27-
services:
28-
memcached:
29-
image: "memcached:${{ matrix.memcached-version }}"
30-
31-
steps:
32-
- name: "Checkout"
33-
uses: "actions/checkout@v3"
34-
with:
35-
submodules: "true"
36-
37-
- name: "Install PHP"
38-
uses: "shivammathur/setup-php@v2"
39-
with:
40-
php-version: "${{ matrix.php-version }}"
41-
42-
- name: "Install dependencies with Composer"
43-
uses: "ramsey/composer-install@v2"
44-
45-
- name: "Run Check configuration"
46-
run: "php data/bin/check_configuration.php"
47-
48-
- name: "Run Tests"
49-
run: "php data/bin/symfony symfony:test --trace"
13+
tests:
14+
name: "Symfony1 Tests"
15+
runs-on: "ubuntu-latest"
16+
17+
strategy:
18+
matrix:
19+
php-version:
20+
- "7.4"
21+
- "8.0"
22+
- "8.1"
23+
- "8.2"
24+
memcached-version:
25+
- "1.6"
26+
27+
services:
28+
memcached:
29+
image: "memcached:${{ matrix.memcached-version }}"
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
with:
35+
submodules: "true"
36+
37+
- name: Install PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: "${{ matrix.php-version }}"
41+
42+
- name: Get composer cache directory
43+
id: composer-cache
44+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
45+
46+
- name: Cache dependencies
47+
uses: actions/cache@v3
48+
with:
49+
path: ${{ steps.composer-cache.outputs.dir }}
50+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
51+
restore-keys: ${{ runner.os }}-composer-
52+
53+
- name: Install dependencies
54+
run: composer install --prefer-dist
55+
56+
- name: Run Check configuration
57+
run: php data/bin/check_configuration.php
58+
59+
- name: Run Tests
60+
run: php data/bin/symfony symfony:test --trace

.github/workflows/lint.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ jobs:
1010
name: 'PHP-CS-Fixer'
1111
runs-on: 'ubuntu-latest'
1212
steps:
13-
- uses: 'actions/checkout@v3'
13+
- uses: actions/checkout@v3
1414

15-
- name: 'Setup PHP'
16-
uses: 'shivammathur/setup-php@v2'
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
1717
with:
18-
php-version: '8.1'
18+
php-version: 8.2
1919
tools: php-cs-fixer, cs2pr
2020

21-
- uses: 'actions/cache@v3'
21+
- uses: actions/cache@v3
2222
with:
2323
path: '.php-cs-fixer.cache'
24-
key: '${{ github.repository }}-8.1-phpcsfixer-${{ github.ref_name }}'
24+
key: ${{ github.repository }}-8.2-phpcsfixer-${{ github.ref_name }}
2525
restore-keys: |
26-
${{ github.repository }}-8.1-phpcsfixer-main
27-
${{ github.repository }}-8.1-phpcsfixer-
26+
${{ github.repository }}-8.2-phpcsfixer-master
27+
${{ github.repository }}-8.2-phpcsfixer-
2828
29-
- name: 'Run PHP-CS-Fixer'
29+
- name: Run PHP-CS-Fixer
3030
# Using cs2pr settings, see: https://github.com/shivammathur/setup-php#tools-with-checkstyle-support
3131
run: 'php-cs-fixer fix --dry-run --format checkstyle | cs2pr'

0 commit comments

Comments
 (0)