-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.55 KB
/
Copy pathci.yml
File metadata and controls
59 lines (50 loc) · 1.55 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
name: PHP API CI
on:
pull_request:
push:
branches:
- develop
- main
tags:
- '*'
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out PHP API
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: dom, json, libxml, mbstring, tokenizer, xml, xmlwriter
tools: composer:v2
coverage: none
- name: Cache Composer downloads
uses: actions/cache@v4
with:
path: ~/.cache/composer/files
key: composer-${{ runner.os }}-${{ hashFiles('composer.lock', 'composer.json') }}
restore-keys: |
composer-${{ runner.os }}-
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Validate package metadata and autoloading
run: |
composer validate --strict --no-check-publish
composer dump-autoload --optimize --strict-psr --no-interaction
- name: Verify release tag metadata
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
set -euo pipefail
VERSION_VALUE=$(tr -d '\r\n' < VERSION)
if [[ "${GITHUB_REF_NAME#v}" != "$VERSION_VALUE" ]]; then
echo "Tag '$GITHUB_REF_NAME' does not match VERSION '$VERSION_VALUE'." >&2
exit 1
fi
- name: Run PHP API tests
run: composer test -- --colors=never