-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (70 loc) · 2.53 KB
/
tests.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
php-version:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
steps:
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
extensions: "yaml"
ini-values: "zend.assertions=1"
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-v3-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-v3-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: Pre-flight checks
run: |
php bin/fileeye-mediaprobe --version
# Remove the comment to the lines below during development, to let
# re-compile the specification PHP file from the YAML files.
# php bin/fileeye-mediaprobe compile
- name: Image file dumps
continue-on-error: true
run: |
php examples/dump-media.php -d tests/media-samples/image/camera/canon_eos_850d_08.jpg
# php examples/dump-media.php -d tests/media-samples/image/broken/gh-10-b.jpg
# php examples/dump-media.php -d tests/media-samples/image/broken/gh-11.jpg
# php examples/dump-media.php -d tests/media-samples/image/broken/pel-176-RPT200076_03.jpg
- name: Run test suite
# continue-on-error: true
run: vendor/bin/phpunit ./tests
# - name: Code style test
# if: ${{ matrix.php-version == 7.4 }}
# run: ./vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1
# Remove the comment to the lines below during development, to refresh the
# media file dumps.
# - name: Update media dumps
# run: php bin/fileeye-mediaprobe dump tests/media-samples tests/media-dumps
# - name: Upload media dumps
# uses: actions/upload-artifact@v3
# with:
# name: media-dumps
# path: tests/media-dumps/**/*.yml
# - name: "Install PHPStan"
# run: "composer require --dev phpstan/phpstan:^1.2 --ansi"
# - name: "Run a static analysis with phpstan/phpstan"
# run: "vendor/bin/phpstan"