setup-php/examples/sage.yml

55 lines
1.9 KiB
YAML
Raw Normal View History

# GitHub Action for roots/sage
name: Testing Sage
on: [push, pull_request]
jobs:
sage:
name: Sage (PHP ${{ matrix.php-versions }} & Node ${{ matrix.node-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']
node-versions: ['8', '10']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
2019-11-28 06:47:56 +07:00
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-versions }}
- name: Setup PHP, with composer and extensions
2019-11-28 06:47:56 +07:00
uses: shivammathur/setup-php@v1 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extension-csv: mbstring
- name: Check node versions
run: node -v
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- 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@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install yarn dependencies
run: yarn -V
- name: Install Composer dependencies
run: composer install -o --prefer-dist --no-interaction
- name: Yarn test and build
run: |
yarn run test
yarn run build
yarn run rmdist
yarn run "build:production"
- name: PHP test
run: composer test