forked from deepflare/bioseqdb
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 2.39 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
name: CI
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Install Postgres
run: sudo apt-get update && sudo apt-get install -y postgresql postgresql-server-dev-14 libpq-dev python3-psycopg2
- name: Install bioinformatics libraries (cache)
id: cache-bioinformatics
uses: actions/cache@v3
with:
path: cache-bioinformatics
key: v1
- name: Install bioinformatics libraries (build)
if: steps.cache-bioinformatics.outputs.cache-hit != 'true'
run: >
git clone --depth 1 --single-branch --recursive "https://github.com/samtools/htslib.git" &&
git clone --depth 1 --single-branch --branch Apache2 "https://github.com/lh3/bwa.git" &&
cd htslib && autoreconf -i && ./configure --disable-bz2 --disable-lzma && make CFLAGS="-g -O2 -fPIC" lib-static && cd .. &&
cd bwa && sed -i 's/ malloc_wrap.o/ malloc_wrap.o\\/' Makefile && sed -i 's/AOBJS=//' Makefile && sed -i '/rle_auxtab/d' rle.h && make CFLAGS="-g -O2 -fPIC" libbwa.a && cd .. &&
mkdir -p cache-bioinformatics/lib cache-bioinformatics/include &&
cp htslib/libhts.a bwa/libbwa.a cache-bioinformatics/lib &&
find bwa htslib -name "*.h" | xargs cp --parents -t cache-bioinformatics/include
- name: Install bioinformatics libraries (install)
run: sudo cp -r cache-bioinformatics/* /usr/local/
- name: Build extension
run: mkdir build && cd build && cmake .. && make
- name: Install extension
run: cd build && sudo make install
- name: Launch Postgres instance
run: sudo systemctl start postgresql && sudo -u postgres psql -c "CREATE USER runner SUPERUSER;"
- name: Test extension
run: python test/run.py
env:
DB_URI: postgres:///postgres
docker:
name: Docker
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t bioseqdb .
- name: Install test dependencies
run: sudo apt-get install -y python3-psycopg2
- name: Launch Docker container
run: sudo docker run -d -e POSTGRES_PASSWORD=password -p 5432:5432 bioseqdb && sleep 5
- name: Test extension on Docker
run: python test/run.py
env:
DB_URI: postgres://postgres:password@localhost/