mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-02-25 03:32:59 +01:00
103 lines
2.5 KiB
YAML
103 lines
2.5 KiB
YAML
name: Testing
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
test-js:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [12.x]
|
|
|
|
name: Test asset generation process on Node ${{ matrix.node-version }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Try to build the assets
|
|
run: |
|
|
npm ci
|
|
npm run production
|
|
- name: Upload built assets
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: assets
|
|
path: public/assets/dist
|
|
- name: Upload mix manifest
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: mix-manifest
|
|
path: public/mix-manifest.json
|
|
|
|
test-php:
|
|
runs-on: ${{ matrix.operating-system }}
|
|
needs: test-js
|
|
strategy:
|
|
matrix:
|
|
operating-system: [ubuntu-latest]
|
|
php-versions: ['7.2', '7.3', '7.4']
|
|
|
|
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions/download-artifact@v1
|
|
with:
|
|
name: assets
|
|
path: public/assets/dist
|
|
|
|
- uses: actions/download-artifact@v1
|
|
with:
|
|
name: mix-manifest
|
|
path: public
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v1
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: mbstring
|
|
|
|
- name: Get Composer Cache Directory
|
|
id: composer-cache
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Prepare the environment
|
|
run: cp .env.example .env
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
run: composer validate
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress --no-suggest
|
|
|
|
- name: Run PHP CS
|
|
run: composer run lint
|
|
|
|
- name: Run PHPunit
|
|
run: composer run test
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: application-logs
|
|
path: storage/logs
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: application-public
|
|
path: public
|