2020-02-24 23:05:19 +03:00
|
|
|
name: Test Suite
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-02 21:04:07 +03:00
|
|
|
- main
|
|
|
|
- 3.x
|
2020-02-24 23:05:19 +03:00
|
|
|
- 2.x
|
2020-03-25 20:18:18 +03:00
|
|
|
- 'renovate/*'
|
2020-04-16 13:01:27 +03:00
|
|
|
env:
|
|
|
|
FORCE_COLOR: 1
|
2020-02-24 23:05:19 +03:00
|
|
|
jobs:
|
2020-10-28 11:05:50 +03:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
|
|
|
name: Lint
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '12.10.0'
|
|
|
|
- run: yarn
|
|
|
|
- run: yarn lint
|
|
|
|
- uses: daniellockyer/action-slack-build@master
|
2021-02-02 21:04:07 +03:00
|
|
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
2020-10-28 11:05:50 +03:00
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
|
2020-11-05 15:58:01 +03:00
|
|
|
migrations:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
DB: ['sqlite3', 'mysql']
|
|
|
|
env:
|
|
|
|
database__client: ${{ matrix.DB }}
|
|
|
|
database__connection__host: 127.0.0.1
|
|
|
|
database__connection__user: root
|
|
|
|
database__connection__password: root
|
|
|
|
database__connection__database: ghost_testing
|
|
|
|
name: Migrations - ${{ matrix.DB }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-17 12:16:03 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
2020-11-05 15:58:01 +03:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '12.10.0'
|
|
|
|
|
|
|
|
- name: Shutdown MySQL
|
|
|
|
run: sudo service mysql stop
|
|
|
|
if: matrix.DB == 'mysql'
|
|
|
|
|
|
|
|
- uses: mirromutth/mysql-action@v1.1
|
|
|
|
if: matrix.DB == 'mysql'
|
|
|
|
with:
|
|
|
|
mysql version: '5.7'
|
|
|
|
mysql database: 'ghost_testing'
|
|
|
|
mysql root password: 'root'
|
|
|
|
|
|
|
|
- run: yarn
|
2020-11-11 13:33:18 +03:00
|
|
|
- run: |
|
|
|
|
node index.js &
|
2020-11-20 11:41:59 +03:00
|
|
|
sleep 20 && { kill $! && wait $!; } 2>/dev/null
|
2021-02-02 13:24:49 +03:00
|
|
|
|
|
|
|
- run: yarn knex-migrator rollback --v 4.0 --force
|
2020-11-05 15:58:01 +03:00
|
|
|
- run: yarn knex-migrator migrate --force
|
|
|
|
|
2020-02-24 23:05:19 +03:00
|
|
|
test:
|
2020-08-18 15:05:15 +03:00
|
|
|
runs-on: ubuntu-18.04
|
2020-03-25 20:18:18 +03:00
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
2020-02-24 23:05:19 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-10-28 14:00:51 +03:00
|
|
|
node: [ '10.13.0', '12.10.0', '14.15.0' ]
|
2020-02-24 23:05:19 +03: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 22:19:00 +03:00
|
|
|
|
2020-03-20 14:05:16 +03: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 23:05:19 +03:00
|
|
|
- run: yarn
|
|
|
|
- run: grunt test-acceptance --verbose
|
|
|
|
- run: grunt test-unit --verbose
|
|
|
|
- run: grunt test-regression --verbose
|
2020-04-16 09:36:15 +03:00
|
|
|
|
2020-06-10 10:58:35 +03:00
|
|
|
- uses: daniellockyer/action-slack-build@master
|
2021-02-02 21:04:07 +03:00
|
|
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
2020-06-10 10:58:35 +03:00
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
2020-06-09 15:21:43 +03:00
|
|
|
|
2020-04-16 09:36:15 +03:00
|
|
|
ghost-cli:
|
|
|
|
name: Ghost-CLI
|
2020-04-16 12:22:14 +03:00
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
2020-08-18 15:05:15 +03:00
|
|
|
runs-on: ubuntu-18.04
|
2020-04-16 09:36:15 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-11-23 14:22:23 +03:00
|
|
|
node-version: '10.13.0'
|
2020-05-28 14:59:08 +03:00
|
|
|
- run: npm install -g ghost-cli@latest
|
2020-06-29 23:46:36 +03: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 09:36:15 +03:00
|
|
|
- run: zip -r ghost.zip .
|
|
|
|
|
|
|
|
- name: Clean Install
|
|
|
|
run: |
|
|
|
|
DIR=$(mktemp -d)
|
|
|
|
ghost install local -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
|
|
|
|
2021-02-02 20:21:56 +03:00
|
|
|
#- name: Latest Release
|
|
|
|
# run: |
|
|
|
|
# DIR=$(mktemp -d)
|
|
|
|
# ghost install local -d $DIR
|
|
|
|
# ghost update -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
|
|
|
|
|
|
|
# - name: Upgrade from latest v1
|
|
|
|
# run: |
|
|
|
|
# DIR=$(mktemp -d)
|
|
|
|
# ghost install v1 --local -d $DIR
|
|
|
|
# ghost update -f -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
|
|
|
|
|
|
|
# - name: Upgrade from latest v2
|
|
|
|
# run: |
|
|
|
|
# DIR=$(mktemp -d)
|
|
|
|
# ghost install v2 --local -d $DIR
|
|
|
|
# ghost update -f -d $DIR --zip $GITHUB_WORKSPACE/ghost.zip
|
2020-06-09 15:21:43 +03:00
|
|
|
|
2020-06-10 10:58:35 +03:00
|
|
|
- uses: daniellockyer/action-slack-build@master
|
2021-02-02 21:04:07 +03:00
|
|
|
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
2020-06-10 10:58:35 +03:00
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
2021-01-19 15:10:50 +03:00
|
|
|
|
|
|
|
canary:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
needs: [lint, migrations, test, ghost-cli]
|
2021-02-02 21:04:07 +03:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
2021-01-19 15:10:50 +03:00
|
|
|
name: Canary
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '12.18.0'
|
|
|
|
|
|
|
|
- name: Set up Git
|
|
|
|
run: |
|
|
|
|
git config --global pull.rebase true
|
|
|
|
git config --global user.name "Ghost CI"
|
|
|
|
git config --global user.email "ghost@example.com"
|
|
|
|
|
|
|
|
- run: yarn
|
2021-01-21 14:36:41 +03:00
|
|
|
- run: grunt master
|
|
|
|
|
2021-01-19 15:10:50 +03:00
|
|
|
- run: echo "ghost_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
|
|
|
- run: echo "ghost_admin_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
|
|
|
working-directory: core/client
|
|
|
|
- run: if [ -n "$(git status --porcelain)" ]; then git add core/client content/themes/casper && git commit -m "Updated Ghost-Admin and Casper"; fi
|
2021-01-21 14:36:41 +03:00
|
|
|
|
2021-02-03 12:29:04 +03:00
|
|
|
- run: npm version prerelease --preid="pre.$ghost_hash.$ghost_admin_hash"
|
|
|
|
- run: npm version prerelease --preid="pre.$ghost_hash.$ghost_admin_hash"
|
2021-01-19 15:10:50 +03:00
|
|
|
working-directory: core/client
|
2021-01-21 14:36:41 +03:00
|
|
|
|
2021-01-19 15:10:50 +03:00
|
|
|
- run: grunt release --skip-update
|
2021-01-21 14:36:41 +03:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
2021-01-19 15:10:50 +03:00
|
|
|
with:
|
|
|
|
name: ghost-canary
|
|
|
|
path: .dist/release/*
|
|
|
|
retention-days: 7
|