Repository navigation
115 lines (103 loc) · 3.34 KB
/
Copy pathqa.yml
File metadata and controls
115 lines (103 loc) · 3.34 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: QA
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
schedule:
- cron: '40 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tests:
permissions:
actions: read
contents: read
env:
TNT_LISTEN_URI: localhost:3301
strategy:
fail-fast: false
max-parallel: 10
matrix:
operating-system: [ubuntu-24.04]
tarantool-release: ['2', '3']
php-version: ['8.2', '8.3', '8.4', '8.5']
include:
- php-version: '8.2'
tarantool-release: '3'
QA: true
- php-version: '8.3'
tarantool-release: '3'
COVERAGE: true
name: PHP ${{ matrix.php-version }}, Tarantool ${{ matrix.tarantool-release }}${{ matrix.QA && ', qa' || '' }}${{ matrix.COVERAGE && ', coverage' || '' }}
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Tarantool and tt
env:
TNT_RELEASE: ${{ matrix.tarantool-release }}
run: |
curl -L "https://tarantool.io/release/$TNT_RELEASE/installer.sh" | sudo bash
sudo apt-get install -y tarantool tarantool-dev tt
tarantool --version
tt version
- name: Install the tarantool/queue module
run: tt rocks install queue
- name: Build PHP image
env:
PHP_IMAGE: php:${{ matrix.php-version }}-cli
TNT_LISTEN_URI: localhost:3301
COVERAGE_FILE: ${{ matrix.COVERAGE && 'coverage.xml' || '' }}
run: ./dockerfile.sh | tee /dev/tty | docker build -t queue -
- name: Test
run: |
tarantool ./tests/Integration/queues.lua > tarantool.log 2>&1 &
for attempt in $(seq 1 30); do
if bash -c 'echo > /dev/tcp/127.0.0.1/3301' 2>/dev/null; then
ready=1
break
fi
sleep 1
done
if [ "${ready:-}" != 1 ]; then
cat tarantool.log
exit 1
fi
docker run --rm --network=host -v "$PWD:/queue" -w /queue queue
- name: Check code quality
if: ${{ matrix.QA }}
run: |
docker run --rm --network=host -v "$PWD:/queue" -w /queue queue php vendor/bin/php-cs-fixer fix --dry-run --diff --verbose .
docker run --rm --network=host -v "$PWD:/queue" -w /queue queue php vendor/bin/psalm
- name: Upload code coverage report
if: ${{ matrix.COVERAGE }}
uses: actions/upload-artifact@v7
with:
name: coverage-${{ strategy.job-index }}
path: coverage.xml
coverage:
needs: tests
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
statuses: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download coverage reports
uses: actions/download-artifact@v8
with:
pattern: coverage-*
path: coverage-reports
- name: Add combined code coverage report to workflow summary
uses: getsentry/coverage-action@0.3.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
directory: coverage-reports
coverage-format: cobertura
enable-tests: false
name: full-test-matrix