2020-02-24 15:05:19 -05:00
|
|
|
name: Test Suite
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-07-06 04:53:49 -05:00
|
|
|
- 3.*
|
2020-02-24 15:05:19 -05:00
|
|
|
- 2.x
|
2020-03-25 12:18:18 -05:00
|
|
|
- 'renovate/*'
|
2020-04-16 05:01:27 -05:00
|
|
|
env:
|
|
|
|
FORCE_COLOR: 1
|
2020-02-24 15:05:19 -05:00
|
|
|
jobs:
|
|
|
|
test:
|
2020-08-18 07:05:15 -05:00
|
|
|
runs-on: ubuntu-18.04
|
2020-03-25 12:18:18 -05:00
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
2020-02-24 15:05:19 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-10-09 08:52:25 -05:00
|
|
|
node: [ '10.13.0', '12.10.0', '14.14.0' ]
|
2020-02-24 15:05:19 -05:00
|
|
|
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 }}
|
2020-03-19 14:19:00 -05:00
|
|
|
|
2020-03-20 06:05:16 -05:00
|
|
|
- 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'
|
|
|
|
|
2020-02-24 15:05:19 -05:00
|
|
|
- run: yarn
|
2020-03-17 07:46:03 -05:00
|
|
|
- run: yarn lint
|
2020-02-24 15:05:19 -05:00
|
|
|
- run: grunt test-acceptance --verbose
|
|
|
|
- run: grunt test-unit --verbose
|
|
|
|
- run: grunt test-regression --verbose
|
2020-04-16 01:36:15 -05:00
|
|
|
|
2020-06-10 02:58:35 -05:00
|
|
|
- uses: daniellockyer/action-slack-build@master
|
|
|
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
2020-06-09 07:21:43 -05:00
|
|
|
|
2020-04-16 01:36:15 -05:00
|
|
|
ghost-cli:
|
|
|
|
name: Ghost-CLI
|
2020-04-16 04:22:14 -05:00
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
2020-08-18 07:05:15 -05:00
|
|
|
runs-on: ubuntu-18.04
|
2020-04-16 01:36:15 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-05-08 01:40:51 -05:00
|
|
|
node-version: '10.13.0'
|
2020-05-28 06:59:08 -05:00
|
|
|
- run: npm install -g ghost-cli@latest
|
2020-06-29 15:46:36 -05:00
|
|
|
- run: npm --no-git-tag-version version minor # We need to artificially bump the minor version to get migrations to run
|
2020-04-16 01:36:15 -05:00
|
|
|
- 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
|
|
|
|
|
2020-08-18 07:10:34 -05:00
|
|
|
- name: Upgrade from latest v1
|
2020-06-30 02:34:48 -05:00
|
|
|
run: |
|
|
|
|
DIR=$(mktemp -d)
|
|
|
|
ghost install v1 --local -d $DIR
|
|
|
|
ghost update -f -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
|
|
|
|
2020-08-18 07:10:34 -05:00
|
|
|
- name: Upgrade from latest v2
|
2020-04-16 01:36:15 -05:00
|
|
|
run: |
|
|
|
|
DIR=$(mktemp -d)
|
|
|
|
ghost install v2 --local -d $DIR
|
|
|
|
ghost update -f -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
2020-06-09 07:21:43 -05:00
|
|
|
|
2020-06-10 02:58:35 -05:00
|
|
|
- uses: daniellockyer/action-slack-build@master
|
|
|
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|