fix ut #105
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Uni-Dock CI/CD | |
on: | |
push: | |
branches: [] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
unidock_test: | |
runs-on: nvidia | |
container: | |
image: nvidia/cuda:12.2.0-devel-ubuntu22.04 | |
options: --gpus all | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: install basic packages | |
run: | | |
apt-get update | |
apt-get install -y build-essential cmake libboost-all-dev ninja-build | |
- if: ${{ env.ACT }} | |
name: Hack container for local development | |
run: | | |
apt-get install -y curl sudo | |
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - | |
sudo apt-get install -y nodejs | |
- name: build | |
run: | | |
cd unidock | |
mkdir build | |
cd build | |
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release | |
cmake --build . | |
cmake --install . | |
cd ../.. | |
- name: validation | |
run: | | |
nvidia-smi | |
unidock --version | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: perform unit-test | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest>=8.0.0 pytest-cov | |
pytest unidock/test/ut -vv --doctest-modules --junitxml=junit/test-results.xml --cov --cov-report term | |
build_docker_image: | |
needs: unidock_test | |
runs-on: ubuntu-latest | |
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 docker buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- 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@v4 | |
with: | |
tags: dptechnology/unidock:${{ steps.short-sha.outputs.sha }},dptechnology/unidock:latest | |
file: Dockerfile | |
context: "{{defaultContext}}:unidock" | |
push: ${{ github.event_name == 'push' }} |