Skip to content

Misc housekeeping

Misc housekeeping #417

Workflow file for this run

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"}'