-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.42 KB
/
unit-test.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
name: Unit Test
on:
workflow_call:
inputs:
redis:
default: no
required: false
type: string
spatialite:
default: no
required: false
type: string
jobs:
unit-test:
runs-on: ubuntu-22.04
permissions:
contents: read
env:
REPO_HOST: ${{ secrets.REPO_HOST }}
REPO_USER: ${{ secrets.REPO_USER }}
REPO_PASS: ${{ secrets.REPO_PASS }}
strategy:
matrix:
php-version:
- "8.3"
- "8.4"
dependency-versions:
- "highest"
- "lowest"
services:
redis:
image: ${{ (inputs.redis == 'yes') && 'redis' || '' }}
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: ${{ (inputs.spatialite == 'yes') && 'Install Spatialite' || 'Skip Spatialite' }}
if: ${{ inputs.spatialite == 'yes' }}
run: sudo apt install sqlite3 libsqlite3-mod-spatialite
- name: ${{ (inputs.spatialite == 'yes') && 'Cache TZ Boundary' || 'Skip TZ Boundary Cache' }}
if: ${{ inputs.spatialite == 'yes' }}
uses: actions/cache@v4
with:
path: "${{ github.workspace }}/tests/cache"
key: "${{ runner.os }}-cache-${{ github.repository_id }}-tz-boundary"
restore-keys: "${{ runner.os }}-cache-${{ github.repository_id }}-tz-boundary"
- name: Cache DEV Tools
uses: actions/cache@v4
with:
path: "${{ github.workspace }}/tools"
key: "${{ runner.os }}-cache-${{ github.repository_id }}-dev-tools"
restore-keys: "${{ runner.os }}-cache-${{ github.repository_id }}-dev-tools"
- name: Setup PHP and Composer
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Authenticate Private Packages
run: composer config --global "http-basic.$REPO_HOST" $REPO_USER $REPO_PASS
- name: Install Dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependency-versions }}
- name: Install Tools
run: composer run-script install-tools
- name: Run PHPUnit Tests
run: composer run-script test