-
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (57 loc) · 2.48 KB
/
smoke-tests.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
# This workflow is especially helpful for pull requests to quickly see if the other tests will definitely fail
name: 🔥 Smoke Tests
on:
pull_request:
jobs:
run-smoke-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Run smoke tests
run: vendor/bin/pest --stop-on-failure --testdox-text testdox.txt
- name: Ping statistics server with test results
run: |
curl https://gist.githubusercontent.com/caendesilva/d76fc6d73cb488863a8f6fda18a7c8c4/raw/1d22747e5064b40e4da05e7666d1ab1d2766de7a/ping-openanalytics-testrunner.php -o ping.php
php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }}
test-coverage:
runs-on: ubuntu-latest
needs: run-smoke-tests
steps:
- uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
with:
php-version: "8.1"
coverage: xdebug
extensions: fileinfo
- uses: actions/checkout@v3
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Set environment to testing
run: echo "ENV=testing" > .env
- name: Execute tests (Unit and Feature tests) via PHPUnit with coverage
run: vendor/bin/pest --coverage --coverage-clover clover.xml
- name: "Publish coverage report to Codecov"
uses: codecov/codecov-action@v3
with:
functionalities: network
- name: Ping statistics server with test results
run: |
curl https://gist.githubusercontent.com/caendesilva/d76fc6d73cb488863a8f6fda18a7c8c4/raw/1d22747e5064b40e4da05e7666d1ab1d2766de7a/ping-openanalytics-testrunner.php -o ping.php
php ping.php "Monorepo Smoke Tests - Coverage" ${{ secrets.OPENANALYTICS_TOKEN }}