forked from bystrogenomics/bystro
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.23 KB
/
python-build-docker.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
name: (ML/Bioinformatics) Build and Run Bystro Python Dockerfile
on:
release:
types: [published]
pull_request:
paths:
- "Dockerfile.python"
workflow_dispatch: # Optional: allows manual triggering of the workflow
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker Image from Local Context
run: |
docker build -t bystro-python -f Dockerfile.python .
- name: Run Docker Image and Capture Help Output
id: help-output
run: |
docker run --rm bystro-python > help_output_python.txt
- name: Assert Help Output Starts with Expected String
run: |
first_line=$(head -n 1 help_output_python.txt)
if [[ "$first_line" == "usage: bystro-api"* ]]; then
echo "Help output assertion passed!"
else
echo "Help output assertion failed. Got: $first_line"
exit 1
fi
- name: Upload Help Output as Artifact
uses: actions/upload-artifact@v3
with:
name: help-output-python
path: help_output_python.txt