setup-php/examples/sage.yml

57 lines
2.1 KiB
YAML
Raw Permalink 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
2020-01-02 00:06:25 +07:00
uses: actions/checkout@v2
- 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 }}
extensions: mbstring
- name: Check node versions
run: node -v
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
2020-06-08 08:39:31 +07:00
- uses: actions/cache@v2
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
2020-06-08 08:39:31 +07:00
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
2019-12-28 01:53:51 +07:00
# 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 yarn dependencies
run: yarn -V
- name: Install Composer dependencies
2020-06-19 12:22:35 +07:00
run: composer install --no-progress --prefer-dist --optimize-autoloader
- 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