Skip to content

bump

bump #379

Workflow file for this run

# GitHub Action for Craft CMS
name: test
on:
push:
pull_request:
schedule:
# every tuesday
- cron: '0 0 * * 3'
jobs:
craft:
name: Craft CMS (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
env:
DB_USER: root
DB_DATABASE: test
DB_SERVER: 127.0.0.1
DB_PASSWORD: password
DB_CHARSET: utf8
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions:
- '8.0'
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Set Node.js 10.x
# uses: actions/setup-node@v1
# with:
# node-version: 10.x
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run Tests
run: |
php ./vendor/bin/codecept build
php ./vendor/bin/codecept run -vv --coverage --coverage-xml
env:
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=test
- name: codecov.io
# only do this once
if: ${{ matrix.php-versions == '7.4' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)