-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (77 loc) · 2.04 KB
/
test.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Test CI
on:
pull_request:
push:
tags:
- "v*"
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
style:
name: Check code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
frontend_testing:
name: Frontend verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: yarn
working-directory: frontend/
- name: Build project
run: yarn run build
working-directory: frontend/
build:
name: Unit Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install library
run: |
pip install .[dev]
pip list
- name: Test with pytest
run: pytest
docker_test:
name: Docker Build Test
runs-on: ubuntu-latest
needs: [style, frontend_testing, build]
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
run: docker build -t pyvista-webapp .
- name: Run Docker Container
run: |
docker run -d --name pyvista_container -p 8000:8000 pyvista-webapp
echo "Container started, beginning health checks..."
- name: Health Check
run: |
for i in {1..10}; do
curl --fail http://localhost:8000/health && echo "Health check passed" && exit 0
echo "Waiting for health check..."
sleep 10
done
echo "Health check failed"
exit 1