Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tests github action #195

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Unit Tests

on:
push:
branches: [main]
pull_request:

jobs:

phpstan:
name: PHPStan
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
php-version: ['8.0', '8.1', '8.2']

steps:
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: gd, intl, pdo_mysql
coverage: none

- run: composer require redaxo/source

- name: Init database
run: |
sudo /etc/init.d/mysql start
mysql -uroot -h127.0.0.1 -proot -e 'create database redaxo5;'

- name: Setup REDAXO
run: |
php vendor/bin/console setup:run -n --lang=de_de --agree-license --db-host=127.0.0.1 --db-password=root --db-createdb=no --db-setup=normal --admin-username=admin --admin-password=adminpassword [email protected] --ansi

- uses: actions/checkout@v3
with:
path: vendor/redaxo/source/redaxo/src/addons/rexstan

- run: php vendor/bin/console package:install rexstan
- run: php vendor/bin/console package:activate rexstan

- run: cd vendor/redaxo/source/redaxo/src/addons/rexstan && composer test