Ghost/.github/workflows/test.yml

83 lines
2.3 KiB
YAML
Raw Normal View History

name: Test Suite
on:
pull_request:
push:
branches:
- master
- 2.x
- 'renovate/*'
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
strategy:
matrix:
node: [ 10, 12 ]
env:
- DB: sqlite3
NODE_ENV: testing
- DB: mysql
NODE_ENV: testing-mysql
env:
DB: ${{ matrix.env.DB }}
NODE_ENV: ${{ matrix.env.NODE_ENV }}
database__connection__password: root
name: Node ${{ matrix.node }} - ${{ matrix.env.DB }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Shutdown MySQL
run: sudo service mysql stop
if: matrix.env.DB == 'mysql'
- uses: mirromutth/mysql-action@v1.1
if: matrix.env.DB == 'mysql'
with:
mysql version: '5.7'
mysql database: 'ghost_testing'
mysql root password: 'root'
- run: yarn
- run: yarn lint
- run: grunt test-acceptance --verbose
- run: grunt test-unit --verbose
- run: grunt test-regression --verbose
if: startsWith(github.head_ref, 'renovate/') || github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'all-tests')
ghost-cli:
name: Ghost-CLI
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v1
with:
node-version: '10'
- run: npm install -g ghost-cli@next
- run: zip -r ghost.zip .
- name: Clean Install
run: |
DIR=$(mktemp -d)
ghost install local -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
- name: Latest Release
run: |
DIR=$(mktemp -d)
ghost install local -d $DIR
ghost update -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
- name: Previous Major
run: |
DIR=$(mktemp -d)
ghost install v2 --local -d $DIR
ghost update -f -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip