-
-
Notifications
You must be signed in to change notification settings - Fork 18
52 lines (43 loc) · 1.45 KB
/
qa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: QA
on:
push:
workflow_dispatch:
schedule:
- cron: '40 2 * * *'
jobs:
tests:
strategy:
matrix:
operating-system: [ubuntu-latest]
env:
- PHP_IMAGE: php:7.1-cli
- PHP_IMAGE: php:7.2-cli
- PHP_IMAGE: php:7.3-cli
- PHP_IMAGE: php:7.4-cli
COVERAGE_FILE: coverage.clover
- PHP_IMAGE: php:8.0-cli
QA: 1
- PHP_IMAGE: php:8.1-cli
- PHP_IMAGE: php:8.2-cli
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build docker image
env: ${{ matrix.env }}
run: ./dockerfile.sh | docker build -t msgpack -
- name: Test
env: ${{ matrix.env }}
run: docker run --rm -v $PWD:/msgpack -w /msgpack msgpack
- name: Check code quality
env: ${{ matrix.env }}
if: ${{ env.QA }}
run: |
docker run --rm -v $PWD:/msgpack -w /msgpack msgpack php vendor/bin/php-cs-fixer fix --dry-run --diff --verbose .
docker run --rm -v $PWD:/msgpack -w /msgpack msgpack php vendor/bin/psalm
- name: Upload code coverage to Scrutinizer
env: ${{ matrix.env }}
if: ${{ env.COVERAGE_FILE }}
run: |
curl -sSOL https://scrutinizer-ci.com/ocular.phar
docker run --rm -v $PWD:/msgpack -w /msgpack msgpack php ocular.phar code-coverage:upload --format=php-clover "$COVERAGE_FILE"