Skip to content

Commit

Permalink
fix: docker mount / feat: add docker build test (#41)
Browse files Browse the repository at this point in the history
* fix: docker mount paths should by default point to the test data

* add docker test and push

* add docker test and push

* add docker test and push
  • Loading branch information
gordonkoehn authored Nov 22, 2024
1 parent 962de78 commit 621ed36
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker Build and Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and test Docker image
run: docker-compose --env-file docker-compose.env up --build --exit-code-from sr2silo

- name: Push to DockerHub
if: github.ref == 'refs/heads/main'
run: |
docker-compose push
4 changes: 2 additions & 2 deletions docker-compose.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SAMPLE_DIR=../../../data/sr2silo/daemon_test/samples/A1_05_2024_10_08/20241024_2411515907/alignments/
SAMPLE_DIR=./tests/data/samples/A1_05_2024_10_08/20241024_2411515907/alignments
SAMPLE_ID=A1_05_2024_10_08
BATCH_ID=20241024_2411515907
TIMELINE_FILE=../../../data/sr2silo/daemon_test/timeline.tsv
TIMELINE_FILE=./tests/data/samples/timeline_A1_05_2024_10_08.tsv
PRIMER_FILE=./tests/data/samples/primers.yaml
NEXTCLADE_REFERENCE=sars-cov2
RESULTS_DIR=./results

0 comments on commit 621ed36

Please sign in to comment.