Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create physionet-build Github CI action #1320

Merged
merged 13 commits into from
Apr 21, 2021
71 changes: 71 additions & 0 deletions .github/workflows/physionet-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# a github action on the dev branch that performs a build - test in a docker container
name: physionet-build-test

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
container:
runs-on: ubuntu-latest
container: debian:10
defaults:
run:
shell: bash
steps:
- name: checkout physionet-build repo
uses: actions/checkout@v2
- name: update packages
run: |
apt-get update --yes
- name: install and configure needed software
run: |
apt-get install sudo python3-dev python3-pip build-essential postgresql zip wget python-virtualenv --yes
ln -sT .env.example .env
- name: install repo dependencies
# add virtual env path to github_path so each run: process will see it
run: |
export VIRTUAL_ENV=/env3
virtualenv -p python3.7 $VIRTUAL_ENV
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
source $VIRTUAL_ENV/bin/activate
pip3 install -r requirements.txt
- name: install libseccomp-dev for syscall filtering
run: |
apt-get install libseccomp-dev
- name: setup postgres
run: |
service postgresql start
sudo -u postgres psql -c "create user physionet with superuser password 'password';" -U postgres
sudo -u postgres psql -c "create database physionet;" -U postgres
- name: install and setup wfdb
run: |
wget https://github.com/bemoody/wfdb/archive/10.6.2.tar.gz -O wfdb.tar.gz
tar -xf wfdb.tar.gz
(cd wfdb-* && ./configure --without-netfiles && make -C lib install && make -C data install)
- name: run linker for newly installed software
run: |
ldconfig
- name: install and setup lightwave
run: |
wget https://github.com/bemoody/lightwave/archive/bfe908a7f53434df61fd2444bf8c235e3e6226fc.tar.gz -O lightwave.tar.gz
tar -xf lightwave.tar.gz
(cd lightwave-* && make CGIDIR=/usr/local/bin sandboxed-server)
wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
- name: install web driver - geckodriver
run: |
mkdir geckodriver
tar -xf geckodriver-v0.23.0-linux64.tar.gz -C geckodriver
echo "$PWD/geckodriver" >> $GITHUB_PATH
- name: setup and test physionet, check amount of code tested
run: |
python physionet-django/manage.py makemigrations --dry-run --no-input --check
python physionet-django/manage.py resetdb
python physionet-django/manage.py loaddemo
python physionet-django/manage.py test --verbosity=3 --keepdb
coverage run --source='.' physionet-django/manage.py test --keepdb
coverage report -m