-
Notifications
You must be signed in to change notification settings - Fork 43
88 lines (71 loc) · 3.01 KB
/
ci.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
88
name: CI
on: [workflow_dispatch, push, pull_request]
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
# https://www.php.net/supported-versions.php
version: ['8.1', '8.2', '8.3', '8.4']
# ubuntu-latest = ubuntu-22.04 (06-2024)
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
runs-on: ubuntu-24.04
steps:
- name: 🤘 Checkout
uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
fetch-depth: 5
- name: 🔽 Setup PHP
uses: shivammathur/setup-php@v2 # https://github.com/shivammathur/setup-php
with:
php-version: ${{matrix.version}}
extensions: dom, mbstring, tidy
ini-values: memory_limit=-1, error_reporting=-1, display_errors=On
- name: 🔽 Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: ✅ PHP lint
run: find . -path ./vendor -prune -o -type f -name '*.php' ! -name "test_with_parse_error.php" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Update Composer
run: composer self-update
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: 🔴🟢🟢🟢 Test
run: vendor/bin/phpunit --configuration ./tests/phpunit.xml.dist
- name: Install old OpenSSL version, which matches PhantomJS
run: |
cd $HOME
mkdir src
mkdir share
cd src
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
sha256sum openssl-1.1.1w.tar.gz
tar xzf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w/
./configure --prefix=$HOME/share/openssl-1.1.1 --openssldir=$HOME/share/openssl-1.1.1 linux-x86_64
make
make install
export OPENSSL_CONF=$HOME/share/openssl-1.1.1
# This tests the installation of the installer using require "dev-main",
# along with the installation of a manually specified PhantomJS version "v2.1.1",
# as defined in the extra section of composer.json.
#
# Reminder:
# If you define version "2.0.0" in composer.json's extra section,
# it should fetch v1.9.8 via retry/auto-lowering, because 2.0.0 doesnt exist.
#
- name: Installer "dev-main" installs a manually specific PhantomJS version
run: |
cd tests/example-extra-version
composer install -vvv --profile
ls -ashF bin
bin/phantomjs -v
# This tests the installation of the installer using require "dev-main",
# along with the installation of the latest version of PhantomJS.
- name: Installer "dev-main" installs latest PhantomJS version
run: |
cd tests/example-latest-version
composer install -vvv --profile
ls -ashF bin
bin/phantomjs -v