-
Notifications
You must be signed in to change notification settings - Fork 20
95 lines (92 loc) · 2.72 KB
/
CI.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
name: CI
on:
push:
branches:
- '*'
- '!master'
pull_request:
branches: [ develop master ]
jobs:
build:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: calcus
POSTGRES_PASSWORD: postgres
POSTGRES_DB: calcus
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
taskqueue:
image: raphaelrobidas/cloud-tasks-emulator:latest
env:
QUEUE_HOST: localhost
QUEUE_PORT: 8123
QUEUE_NAME: projects/test-project/locations/us-central1/queues/xtb-compute,projects/test-project/locations/us-central1/queues/actions
ports:
- 8123:8123
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
- name: Install binary dependencies
run: |
sudo apt-get install openbabel sshpass postgresql-client dos2unix -y
- name: Environment setup
run: |
dos2unix scripts/*
mkdir -p scratch/keys
mkdir -p scratch/scr
tar xvfj bin/Multiwfn.tar.bz2 -C bin
PGPASSWORD=postgres createdb -h localhost -p 5432 -U calcus test_calcus
- name: Run tests
run: |
python3 manage.py makemigrations
python3 manage.py makemigrations frontend
python3 manage.py migrate
python3 manage.py init_static_obj
coverage run manage.py test
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_PASSWORD: postgres
POSTGRES_USER: calcus
CALCUS_TEST: True
IS_TEST_CLUSTER_DAEMON: True
CAN_USE_CACHED_LOGS: true
USE_CACHED_LOGS: true
CALCUS_TEST_MAX_ATTEMPTS: 5
GCP_LOCATION: us-central1
GCP_PROJECT_ID: test-project
GCP_SERVICE_ACCOUNT_EMAIL: [email protected]
COMPUTE_SMALL_HOST_URL: localhost:8000
ACTION_HOST_URL: localhost:8000
MULTIWFN_DIR: ${{ github.workspace}}/bin
trigger_cloud_build:
needs: build
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
name: Trigger Cloud Build
runs-on: ubuntu-latest
steps:
- name: Trigger Build
uses: jasongitmail/fast-webhook@v1
with:
url: ${{ secrets.GCLOUD_BUILD_URL }}
json: '{"build": "build"}'