Skip to content

ci(release): fix workflows #10

ci(release): fix workflows

ci(release): fix workflows #10

Workflow file for this run

name: Tests
on:
push:
branches: ['main', 'develop']
pull_request:
branches: ['main', 'develop']
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2]
use-mariadb: [false, true]
services:
mariadb:
image: ${{ matrix.use-mariadb && 'mariadb:11' || '' }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: tests
ports:
- 33306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
name: Tests | PHP ${{ matrix.php }} | MariaDB ${{ matrix.use-mariadb }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ctype, curl, dom, fileinfo, filter, hash, json, libxml, mbstring, openssl, pcre, phar, session, tokenizer, xml, xmlwriter
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- name: Copy environment file
run: cp .env.example .env
- name: Generate app key
run: php artisan key:generate
- name: Execute tests (without MariaDB)
run: composer test-coverage
if: matrix.use-mariadb == false
- name: Execute tests (with MariaDB)
run: composer test-coverage
if: matrix.use-mariadb == true
env:
DB_CONNECTION: mysql
DB_DATABASE: tests
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
DB_USERNAME: root
- name: Upload coverage
uses: codecov/codecov-action@v3
if: matrix.php == '8.2' && matrix.use-mariadb == false
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
slug: m-thalmann/SecureDAV