-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (59 loc) · 1.81 KB
/
ci.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
name: CI
on:
push:
# Sequence of patterns matched against refs/heads
branches:
# Push events on main and dev branch
- main
- training-tests
# Sequence of patterns matched against refs/tags
tags: '*'
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21.6.0' # Match the version in your Dockerfile
- name: Install UI dependencies
working-directory: ./ui
run: |
npm ci
npm install --save-dev @vitest/coverage-v8
- name: Run tests with coverage
working-directory: ./ui
run: npm run test:coverage
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: ui/coverage/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Make run.sh executable
run: chmod +x ./run.sh
- name: Docker build training, backend, and frontend
run: ./run.sh
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r training/requirements.txt
pip install pytest pytest-cov
cd training && pip install -e .
- name: Run tests with pytest and generate coverage
run: |
cd /home/runner/work/AlphaFind/AlphaFind/training
export PYTHONPATH=$PYTHONPATH:$(pwd)
pytest -v --cov=. --cov-report=xml --cov-report=term-missing
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: training/coverage.xml