Skip to content

Commit 8d045bd

Browse files
committed
Update(github) Update github workflows, use composer caches
1 parent 4625750 commit 8d045bd

File tree

1 file changed

+44
-32
lines changed

1 file changed

+44
-32
lines changed
Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
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: "Doctrine1 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-
25-
steps:
26-
- name: "Checkout"
27-
uses: "actions/checkout@v3"
28-
29-
- name: "Install PHP"
30-
uses: "shivammathur/[email protected]"
31-
with:
32-
php-version: "${{ matrix.php-version }}"
33-
# extensions: "${{ matrix.extension }}"
34-
35-
- name: "Install dependencies with Composer"
36-
uses: "ramsey/[email protected]"
37-
38-
- name: "Run Tests"
39-
run: "cd tests && php run.php"
13+
tests:
14+
name: "Doctrine1 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+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
with:
29+
submodules: "true"
30+
31+
- name: Install PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: "${{ matrix.php-version }}"
35+
36+
- name: Get composer cache directory
37+
id: composer-cache
38+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
39+
40+
- name: Cache dependencies
41+
uses: actions/cache@v3
42+
with:
43+
path: ${{ steps.composer-cache.outputs.dir }}
44+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
45+
restore-keys: ${{ runner.os }}-composer-
46+
47+
- name: Install dependencies
48+
run: composer install --prefer-dist
49+
50+
- name: Run Tests
51+
run: cd tests && php run.php

0 commit comments

Comments
 (0)