Skip to content

Commit 67f99c3

Browse files
committed
TASK: Add github workflow for quality assurance
1 parent a06c6f1 commit 67f99c3

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ indent_size = 2
2222
[*.xml]
2323
indent_style = space
2424
indent_size = 2
25+
26+
[*.yml]
27+
indent_style = space
28+
indent_size = 2
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Set up PHP'
2+
description: 'Set up PHP and composer incl. caches'
3+
inputs:
4+
php-version:
5+
description: 'The version of PHP to set up'
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
11+
- uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: ${{ inputs.php-version }}
14+
coverage: xdebug
15+
16+
- id: composer-cache
17+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
18+
shell: bash
19+
20+
- uses: actions/cache@v2
21+
with:
22+
path: ${{ steps.composer-cache.outputs.dir }}
23+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
24+
restore-keys: ${{ runner.os }}-composer-
25+
26+
- run: composer install
27+
shell: bash

.github/workflows/qa.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: QA
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main, '[0-9]+.[0-9]' ]
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
# This allows a subsequently queued workflow run to interrupt previous runs
13+
concurrency:
14+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
15+
cancel-in-progress: true
16+
17+
jobs:
18+
static-analysis:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: ./.github/actions/setup-php
23+
with:
24+
php-version: '8.1'
25+
26+
- name: Static Code Analysis with phpstan
27+
run: ./scripts/analyse
28+
shell: bash
29+
30+
tests:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
php-version: ['8.1', '8.2']
35+
testsuite: ['unit', 'integration']
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: ./.github/actions/setup-php
39+
with:
40+
php-version: ${{ matrix.php-version }}
41+
42+
- name: Testsuite "${{ matrix.testsuite }}" with phpunit
43+
run: |
44+
./scripts/test --testsuite ${{ matrix.testsuite }}

0 commit comments

Comments
 (0)