Skip to content

Commit

Permalink
Create test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Oct 1, 2024
1 parent ae8d6d7 commit d69c292
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Github Actions Test

on: [push]
jobs:
build:
runs-on: ubuntu-latest
# Add in environment variables for the entire "build" job
env:
POSTGRES_USER: admin
POSTGRES_PASSWORD: OG0pjmnQDWUTvLotYrxPrg
POSTGRES_HOST: localhost
POSTGRES_HOST_AUTH_METHOD: password
POSTGRES_DB: metadata
POSTGRES_PORT: 5432
services:
postgres_main:
image: postgres:latest
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
HTSGET_TEST_KEY: thisisatest
DB_PATH: localhost
SERVER_LOCAL_DATA: /home/travis/build/CanDIG/htsget_app/data
PGPASSWORD: OG0pjmnQDWUTvLotYrxPrg
INDEXING_PATH: /home/travis/build/CanDIG/tmp
TESTENV_URL: http://localhost:3000
AGGREGATE_COUNT_THRESHOLD: 5
POSTGRES_USERNAME: admin
strategy:
matrix:
python-version: ['3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r requirements.txt
bash create_db.sh
mkdir -p ${{ env.INDEXING_PATH }}
sed -i s@\<AGGREGATE_COUNT_THRESHOLD\>@${{env.AGGREGATE_COUNT_THRESHOLD}}@ config.ini
sed -i s@\<POSTGRES_USERNAME\>@${{env.POSTGRES_USERNAME}}@ config.ini
python htsget_server/server.py &
python htsget_server/indexing.py &
sleep 5
- name: Test with pytest
run: pytest tests/test_htsget_server.py

0 comments on commit d69c292

Please sign in to comment.