forked from php-tuf/php-tuf
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (78 loc) · 2.66 KB
/
build.yml
File metadata and controls
101 lines (78 loc) · 2.66 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Run this workflow at 3 AM UTC every day.
- cron: '0 3 * * *'
workflow_dispatch:
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist --optimize-autoloader"
jobs:
build:
name: PHP ${{ matrix.php }} test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
max-parallel: 10
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
experimental: [false]
include:
- operating-system: ubuntu-latest
php: 8.1
experimental: true
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: sodium, json
tools: composer:v2
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Require dependencies
run: 'composer require --no-update ${{ matrix.dependencies }}'
- name: Install dependencies
run: 'composer install ${{ env.COMPOSER_FLAGS }}'
- name: PHP linting
if: matrix.operating-system != 'windows-latest'
run: composer lint
- name: Run PHPCS
run: composer phpcs
- name: Generate fixtures
run: composer fixtures
- name: Run test suite
run: composer test
- name: Check dependencies for known security vulnerabilities
run: composer audit --no-dev
build-lowest-version:
name: Build lowest version
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
run: 'composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest'
- name: Generate fixtures
run: composer fixtures
- name: Run test suite
run: composer test