This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
forked from dptech-corp/Uni-Dock
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (113 loc) · 3.16 KB
/
ci_tools.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Uni-Dock Tools CI/CD
on:
push:
branches: []
pull_request:
branches: [ main ]
env:
BASE_IMAGE_VERSION: "0.0.1"
PYTHON_VERSION: "3.11"
jobs:
flake8:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: $PYTHON_VERSION
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run flake8 formating
run: |
flake8 unidock_tools/unidock_tools --exit-zero
pyright:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: $PYTHON_VERSION
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyright
- name: Run pyright check
id: pyright_check
working-directory: ./unidock_tools
run: |
pyright
tests:
if: ${{ always() }}
needs: [flake8,pyright]
runs-on: nvidia
strategy:
matrix:
cuda-version: ["12.0.0"]
container:
image: docker.io/xmyyn/unidock_tools_base:$BASE_IMAGE_VERSION_cuda${{ matrix.cuda-version }}
options: --gpus all
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: install unidock
working-directory: ./unidock
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build .
cmake --install .
cd ..
-name: check env
run: |
unidock --version
confgen --version
which python
- name: install tools
working-directory: ./unidock_tools
run: |
pip install .
- name: run unit-test
run: |
pip install pytest pytest-cov
pytest unidock_tools/tests/ut -vv --cov --cov-report term
- name: run application e2e test
run: |
pytest unidock_tools/tests/applications -vv --cov --cov-report term
build_docker_image:
needs: tests
runs-on: ubuntu-latest
strategy:
matrix:
cuda-version: ["12.0.0"]
steps:
- name: log in to docker hub
uses: docker/login-action@v3
if: github.event_name == 'push'
with:
username: dptechnology
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: check commit short sha
run: echo ${{ steps.short-sha.outputs.sha }}
- name: build and push container
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
build-args: BASE_IMAGE=xmyyn/unidock_tools_base:$BASE_IMAGE_VERSION_cuda${{ matrix.cuda-version }}
tags: dptechnology/unidock_tools:${{ steps.short-sha.outputs.sha }},dptechnology/unidock_tools:latest
file: unidock_tools/containers/Dockerfile
push: ${{ github.event_name == 'push' }}