V4.2.2 #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_USER: stufis_ci | |
MYSQL_DATABASE: stufis_ci | |
MYSQL_PASSWORD: password | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: [ '8.2' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, dom, fileinfo, mysql, libxml, xml, xmlwriter, dom, tokenizer, filter, json, phar, pcre, openssl, pdo, intl, curl | |
coverage: xdebug | |
- name: Run composer install | |
run: | | |
composer config http-basic.composer.fluxui.dev ${{secrets.FLUXUI_USERNAME}} ${{secrets.FLUXUI_PASSWORD}} | |
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | |
- name: Prepare Laravel Application | |
run: | | |
cp .env.ci .env.testing | |
- name: Verify mariadb connection | |
run: | | |
sudo apt install mariadb-client | |
mariadb --version | |
mariadb --host localhost --port 3306 -ustufis_ci -ppassword -e "SHOW DATABASES" | |
- name: Run Migration | |
run: php artisan migrate -v --seed --env=testing | |
- name: Test with phpunit | |
run: php artisan test --coverage |