-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (54 loc) · 2 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
name: Test
on:
pull_request:
branches:
- master
jobs:
test:
name: Test on OTP ${{ matrix.otp_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
otp_version: [21.3]
os: [ubuntu-latest]
container:
image: erlang:${{ matrix.otp_version }}
env:
ZOTONIC_DIR: /tmp/zotonic
# Start PostgreSQL wth 'zotonic' as the default user.
services:
postgres:
image: postgres:9.6
env:
POSTGRES_DB: zotonic
POSTGRES_USER: zotonic
POSTGRES_PASSWORD: zotonic
# Set health checks to wait until postgres has started.
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install and configure Zotonic
run: |
git clone https://github.com/zotonic/zotonic.git $ZOTONIC_DIR --branch 0.x
mkdir -p ~/.zotonic/0 ${ZOTONIC_DIR}/user
sed "s|\.\.\/ginger/modules|$GITHUB_WORKSPACE/modules|" config/zotonic-test.config > ~/.zotonic/0/zotonic.config
- name: Install dependencies
run: |
git clone https://github.com/driebit/mod_elasticsearch.git modules/mod_elasticsearch
git clone https://github.com/driebit/mod_elasticsearch2.git modules/mod_elasticsearch2
- name: Compile
working-directory: ${{ env.ZOTONIC_DIR }}
run: make all
- name: Run tests
working-directory: ${{ env.ZOTONIC_DIR }}
env:
ERL: "erl -noshell"
ZOTONIC_DBHOST: postgres
run: $GITHUB_WORKSPACE/scripts/runtests.sh