2019-09-11 23:32:56 +08:00
|
|
|
name: CI
|
|
|
|
|
2019-12-05 19:01:03 +08:00
|
|
|
on:
|
|
|
|
push:
|
2019-12-10 11:09:08 +08:00
|
|
|
branches:
|
|
|
|
- dev
|
2020-03-12 11:19:17 +08:00
|
|
|
paths-ignore:
|
|
|
|
- 'resources/lang/**'
|
|
|
|
- '**.md'
|
2019-12-05 19:01:03 +08:00
|
|
|
pull_request:
|
2019-12-10 11:09:08 +08:00
|
|
|
branches:
|
|
|
|
- dev
|
2020-03-12 11:19:17 +08:00
|
|
|
paths-ignore:
|
|
|
|
- 'resources/lang/**'
|
|
|
|
- '**.md'
|
2019-09-11 23:32:56 +08:00
|
|
|
|
|
|
|
jobs:
|
2020-06-04 21:50:46 +08:00
|
|
|
php-lint:
|
|
|
|
name: PHP Linting
|
2019-09-11 23:32:56 +08:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-07 23:54:06 +08:00
|
|
|
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
2019-09-11 23:32:56 +08:00
|
|
|
steps:
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Checkout code
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-05-30 10:55:30 +08:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 7.4
|
|
|
|
coverage: none
|
|
|
|
extensions: mbstring, dom, fileinfo, gd
|
2019-09-11 23:32:56 +08:00
|
|
|
- name: Install dependencies
|
2020-06-04 21:50:46 +08:00
|
|
|
run: |
|
|
|
|
composer install --prefer-dist --no-progress --no-suggest
|
|
|
|
composer global require friendsofphp/php-cs-fixer
|
2019-09-17 23:17:56 +08:00
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
cp .env.example .env
|
|
|
|
php artisan key:generate
|
2020-06-28 15:59:42 +08:00
|
|
|
mkdir -p resources/views/overrides
|
2019-09-17 23:10:44 +08:00
|
|
|
- name: Validate Twig templates
|
|
|
|
run: php artisan twig:lint -v
|
2020-06-04 21:50:46 +08:00
|
|
|
- name: Check coding style
|
|
|
|
run: php-cs-fixer fix --dry-run --stop-on-violation --diff-format=udiff
|
2019-12-03 11:40:06 +08:00
|
|
|
php:
|
|
|
|
name: PHP ${{ matrix.php }} Tests
|
2019-09-11 23:34:42 +08:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-07 23:54:06 +08:00
|
|
|
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
2019-12-03 11:40:06 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php: ['7.2', '7.3', '7.4']
|
2019-09-11 23:34:42 +08:00
|
|
|
steps:
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Checkout code
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: actions/checkout@v2
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Setup PHP only
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: shivammathur/setup-php@v2
|
2019-12-03 11:40:06 +08:00
|
|
|
if: matrix.php != '7.2'
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
|
|
|
coverage: none
|
2019-12-22 23:05:49 +08:00
|
|
|
extensions: mbstring, dom, fileinfo, sqlite, gd, zip
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Setup PHP with Xdebug
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: shivammathur/setup-php@v2
|
2019-12-03 11:40:06 +08:00
|
|
|
if: matrix.php == '7.2'
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
|
|
|
coverage: xdebug
|
2019-12-22 23:05:49 +08:00
|
|
|
extensions: mbstring, dom, fileinfo, sqlite, gd, zip
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Cache Composer dependencies
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: vendor
|
|
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install Composer dependencies
|
|
|
|
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run tests only
|
|
|
|
if: matrix.php != '7.2'
|
2020-03-09 15:08:45 +08:00
|
|
|
run: ./vendor/bin/phpunit
|
2019-12-03 11:40:06 +08:00
|
|
|
shell: pwsh
|
|
|
|
- name: Run tests with coverage report
|
|
|
|
if: matrix.php == '7.2'
|
2020-03-09 15:08:45 +08:00
|
|
|
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
|
2019-12-03 11:40:06 +08:00
|
|
|
shell: pwsh
|
|
|
|
- name: Upload coverage report
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
if: matrix.php == '7.2' && success()
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
name: github-actions
|
|
|
|
lint:
|
|
|
|
name: Frontend Linting
|
|
|
|
runs-on: ubuntu-latest
|
2019-12-07 23:54:06 +08:00
|
|
|
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
2019-12-03 11:40:06 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: actions/checkout@v2
|
2019-09-11 23:34:42 +08:00
|
|
|
- name: Install dependencies
|
2020-05-30 11:10:38 +08:00
|
|
|
run: yarn
|
2019-09-15 14:46:21 +08:00
|
|
|
- name: Run checks
|
2019-09-11 23:34:42 +08:00
|
|
|
run: |
|
2020-02-10 11:45:25 +08:00
|
|
|
# yarn lint
|
2020-01-16 16:14:49 +08:00
|
|
|
yarn tsc -p . --noEmit
|
2020-01-21 10:22:20 +08:00
|
|
|
yarn tsc -p ./resources/assets/tests --noEmit
|
2019-12-03 11:40:06 +08:00
|
|
|
jest:
|
|
|
|
name: Frontend Tests
|
|
|
|
runs-on: ubuntu-latest
|
2019-12-07 23:54:06 +08:00
|
|
|
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
2019-12-03 11:40:06 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2020-02-29 16:44:36 +08:00
|
|
|
uses: actions/checkout@v2
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Install dependencies
|
2020-05-30 11:10:38 +08:00
|
|
|
run: yarn
|
2019-12-03 11:40:06 +08:00
|
|
|
- name: Run tests
|
|
|
|
run: yarn test --coverage
|
|
|
|
- name: Upload coverage report
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
name: github-actions
|