Skip to content

Commit 916ab81

Browse files
authored
Create test.yaml
1 parent d287e15 commit 916ab81

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/test.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ "*" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
9+
jobs:
10+
run-tests:
11+
concurrency:
12+
group: tests-${{ github.ref }}-${{ matrix.php-versions }}
13+
cancel-in-progress: true
14+
strategy:
15+
matrix:
16+
php-versions: ['8.0']
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 2
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, mysql, intl, gd, exif, iconv
27+
coverage: pcov
28+
- name: Get composer cache directory
29+
id: composercache
30+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ${{ steps.composercache.outputs.dir }}
35+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: ${{ runner.os }}-composer-
37+
- name: Install Dependencies
38+
run: composer install --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-reqs
39+
- name: Execute tests via PHPUnit
40+
run: php -d pcov.enabled=1 -d memory_limit=4G vendor/bin/phpunit --log-junit build/logs/junit-log.xml --coverage-clover=build/logs/clover.xml
41+
- name: Coverage Upload
42+
env:
43+
OTTERWISE_TOKEN: ${{ secrets.OTTERWISE_TOKEN }}
44+
run: bash <(curl -s https://raw.githubusercontent.com/getOtterWise/bash-uploader/main/uploader.sh) --log-file build/logs/junit-log.xml
45+
46+
47+
# todo create deploy request in PlanetScale

0 commit comments

Comments
 (0)