forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (93 loc) · 3.05 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Test Suite
on:
pull_request:
push:
branches:
- master
- 3.*
- 2.x
- 'renovate/*'
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
strategy:
matrix:
node: [ '10.13.0', '12.10.0', '14.14.0' ]
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
- 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 }}
ghost-cli:
name: Ghost-CLI
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v1
with:
node-version: '10.13.0'
- run: npm install -g ghost-cli@latest
- run: npm --no-git-tag-version version minor # We need to artificially bump the minor version to get migrations to run
- 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: 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
- 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 }}