Skip to content

Commit b8ebc84

Browse files
committed
.github/workflows: test against multiple php versions
1 parent da522d6 commit b8ebc84

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

.github/workflows/document.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: phpunit
2+
3+
on: release
4+
5+
jobs:
6+
document:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/cache@v4
11+
with:
12+
path: vendor
13+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
14+
restore-keys: ${{ runner.os }}-composer-
15+
- name: composer
16+
run: composer update
17+
- name: document
18+
run: |
19+
docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 --directory=src --directory=vendor/sweetrdf/rdf-interface/src --directory=vendor/sweetrdf/rdf-helpers/src/ --directory=vendor/ml/json-ld --target=docs
20+
git fetch && git checkout docs --
21+
for i in `ls -1 | grep -v ^docs$`; do rm -fR $i ; done
22+
cp -R docs/* .
23+
git config user.email "[email protected]"
24+
git config user.name "Github Actions Workflow"
25+
git add * || true
26+
git commit -a -m 'Automatic documentation generation' && git push origin docs || true

.github/workflows/test.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ on: push
44

55
jobs:
66
phpunit:
7+
strategy:
8+
matrix:
9+
php: [8.1, 8.2, 8.3, 8.4]
710
runs-on: ubuntu-latest
811
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/cache@v2
12+
- uses: actions/checkout@v4
13+
- uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: ${{ matrix.php }}
16+
extensions: dom,json,mbstring,pcre,xmlreader
17+
coverage: xdebug
18+
env:
19+
fail-fast: true
20+
- uses: actions/cache@v4
1121
with:
1222
path: vendor
1323
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
14-
restore-keys: ${{ runner.os }}-composer-
24+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
1525
- name: composer
1626
run: composer update
1727
- name: phpunit
@@ -21,16 +31,6 @@ jobs:
2131
export COVERALLS_RUN_LOCALLY=1
2232
export COVERALLS_REPO_TOKEN=${{ secrets.coverallsToken }}
2333
php vendor/bin/php-coveralls -v
24-
- name: document
25-
run: |
26-
docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 --directory=src --directory=vendor/sweetrdf/rdf-interface/src --directory=vendor/sweetrdf/rdf-helpers/src/ --directory=vendor/ml/json-ld --target=docs
27-
git fetch && git checkout docs --
28-
for i in `ls -1 | grep -v ^docs$`; do rm -fR $i ; done
29-
cp -R docs/* .
30-
git config user.email "[email protected]"
31-
git config user.name "Github Actions Workflow"
32-
git add * || true
33-
git commit -a -m 'Automatic documentation generation' && git push origin docs || true
3434
phpstan:
3535
runs-on: ubuntu-latest
3636
steps:

0 commit comments

Comments
 (0)