Skip to content

Commit fb1eb7a

Browse files
authored
Start adding github action
1 parent fcb4597 commit fb1eb7a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/php.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test docopt.php
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php-version: ["7.2", "7.3", "7.4", "8.0"]
14+
15+
steps:
16+
- name: Setup PHP ${{ matrix.php-version }}
17+
uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
18+
with:
19+
php-version: ${{ matrix.php-version }}
20+
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: true
24+
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate --strict
27+
28+
- name: Cache Composer packages
29+
id: composer-cache
30+
uses: actions/cache@v3
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-
36+
37+
- name: Install dependencies
38+
run: composer install --prefer-dist --no-progress
39+
40+
- name: Run test suite
41+
run: php test.php

0 commit comments

Comments
 (0)