forked from torchbox/wagtailmedia
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.52 KB
/
nightly-tests.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
name: Nightly Wagtail test
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
nightly-test:
# Cannot check the existence of secrets, so limiting to repository name to prevent all forks to run nightly.
# See: https://github.com/actions/runner/issues/520
if: ${{ github.repository == 'torchbox/wagtailmedia' }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.7
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "psycopg2>=2.6"
pip install "git+https://github.com/wagtail/wagtail.git@main#egg=wagtail"
pip install -e .[testing]
- name: Test
id: test
continue-on-error: true
run: |
./runtests.py
env:
DATABASE_ENGINE: django.db.backends.postgresql
DATABASE_HOST: localhost
DATABASE_USER: postgres
DATABASE_PASS: postgres
- name: Send Slack notification on failure
if: steps.test.outcome == 'failure'
run: |
python .github/report_nightly_build_failure.py
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}