-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (54 loc) · 1.79 KB
/
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
name: Tests
on:
pull_request:
paths:
- "**.php"
- ".github/workflows/test.yml"
- ".ci/docker-compose.yml"
- ".ci/ntfy-server.yml"
push:
branches: [main]
paths:
- "**.php"
- ".github/workflows/test.yml"
- ".ci/docker-compose.yml"
- ".ci/ntfy-server.yml"
permissions:
contents: read
jobs:
test:
name: PHPUnit
runs-on: ubuntu-22.04
env:
COMPOSE_FILE: .ci/docker-compose.yml
NTFY_URI: "http://127.0.0.1:8080"
HTTPBIN_URI: "http://127.0.0.1:8081"
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: '8.1'
coverage: xdebug
extensions: mbstring
- 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: "Validate composer.json and composer.lock"
run: "composer validate --strict"
- name: Install dependencies with composer
run: composer install --prefer-dist
- name: Start ntfy & httpbin docker containers
run: docker-compose up -d
- name: Test connections to docker containers
run: bash .ci/scripts/test-connections.sh
- name: Run phpunit
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Stop ntfy & httpbin docker docker containers
run: docker-compose down
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}