Skip to content

Commit f2af07c

Browse files
committed
add test to workflow
1 parent 44586f1 commit f2af07c

22 files changed

+108327
-22
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
name: Publish Services to GHCR
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
4+
workflow_run:
5+
workflows: [Test]
6+
types:
7+
- completed
108

119
jobs:
1210
build:
13-
needs: test
1411
runs-on: ubuntu-latest
15-
1612
env:
1713
DASHBOARD_IMAGE_NAME: intersect-dashboard
1814
DASHBOARD_SERVICE_IMAGE_NAME: intersect-service
1915
STORAGE_SERVICE_IMAGE_NAME: intersect-storage
2016

17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2118
steps:
2219
- name: Checkout repository
2320
uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Miniconda
19+
uses: conda-incubator/setup-miniconda@v2
20+
with:
21+
conda-version: "24.11.2"
22+
auto-activate-base: false
23+
24+
- name: Install dependencies
25+
run: |
26+
conda env create -f config/environment.yaml
27+
conda run --no-capture-output -n espd_mantid pip install pytest
28+
29+
- name: Run tests
30+
run: |
31+
conda run --no-capture-output -n espd_mantid python -m pytest

Dockerfile.dashboard

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ EXPOSE 10042
2929
ENV BOKEH_ALLOW_WS_ORIGIN="*"
3030

3131
CMD ["conda", "run", "--no-capture-output", "-n", "espd_mantid", "python", "-m", "panel", "serve", "dashboard.py", "--address", "0.0.0.0", "--allow-websocket-origin", "*", "--port", "10042"]
32-

Dockerfile.dashboard_service

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ COPY ./config/config_dashboard.yaml /app/config_dashboard_default.yaml
1414
EXPOSE 10043
1515

1616
ENTRYPOINT ["python", "dashboard_service.py"]
17-
18-
19-

Dockerfile.storage_service

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ COPY ./services/constants.py ./constants.py
1111
EXPOSE 10044
1212

1313
ENTRYPOINT ["python" ,"storage_service.py"]
14-
15-

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<p align="center">
55
<a href="https://www.python.org/downloads/release/python-310/"><img alt="Python 3.10" src="https://img.shields.io/badge/Python-3.10-3776AB.svg?style=flat&logo=python&logoColor=white"></a>
66
<a href="https://www.docker.com"><img alt="Docker" src="https://badges.aleen42.com/src/docker.svg"></a>
7+
<img src="https://github.com/nsdf-fabric/NSDF-INTERSECT/actions/workflows/test.yml/badge.svg" alt="test status badge">
78
<img src="https://github.com/nsdf-fabric/NSDF-INTERSECT/actions/workflows/publish.yml/badge.svg" alt="publish status badge">
89
<img src="https://github.com/nsdf-fabric/NSDF-INTERSECT/actions/workflows/deploy-linode.yml/badge.svg" alt="linode intersect chart cluster deployment status badge">
910
</p>

clients/single_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from schema import FileType, TransitionData, NextTemperature
2727

2828
logging.basicConfig(level=logging.INFO)
29-
CONFIG_CLIENT = "config_client.yaml"
29+
CONFIG_CLIENT = "config/config_client.yaml"
3030

3131
transition_data = [
3232
[284.89, 0.9353496748096445, 1.5583828040832086],

clients/transition_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
[200.00, 1.426667976082179, 0.16991445836095545],
6565
]
6666

67-
CONFIG_CLIENT = "config_client.yaml"
67+
CONFIG_CLIENT = "config/config_client.yaml"
6868

6969

7070
def generate_y_list(ylen: int) -> List[float]:

services/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
from .dashboard import AppState, App
2-
from .dashboard_service import FileType, TransitionData, NextTemperature
32

4-
__all__ = ["AppState", "App", "FileType", "TransitionData", "NextTemperature"]
3+
__all__ = ["AppState", "App"]

services/dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def App() -> MaterialTemplate:
508508
pn.extension("plotly")
509509
app_state = AppState()
510510

511-
config_path = os.getenv(INTERSECT_DASHBOARD_CONFIG, "./config_dashboard.yaml")
511+
config_path = os.getenv(INTERSECT_DASHBOARD_CONFIG, "/app/config_dashboard_default.yaml")
512512
try:
513513
with open(config_path) as f:
514514
app_state.config = yaml.safe_load(f)

0 commit comments

Comments
 (0)