Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
pull_request:
branches:
- coo-consistency-check
push:
branches:
- coo-consistency-check

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- name: CheckCode
uses: actions/checkout@v3

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ libgflags-dev unixodbc unixodbc-dev odbcinst locales curl
sudo locale-gen en_US.UTF-8

- name: Check Python version
run: |
python --version
pip --version

- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install certifi

- name: Compile 3TSCOO
working-directory: ./src/dbtest
run: |
set -e
cmake -S ./
make

- name: Verify the compilation output
working-directory: ./src/dbtest
run: |
set -e
if [ -f 3ts_dbtest ]; then echo "3ts_dbtest exists"; else echo "3ts_dbtest not found"; exit 1; fi
if [ -f 3ts_dbtest_v2 ]; then echo "3ts_dbtest_v2 exists"; else echo "3ts_dbtest_v2 not found"; exit 1; fi

- name: Check executable file update time
working-directory: ./src/dbtest
run: |
set -e
BUILD_TIME=$(date +%s)
FILE1_TIME=$(stat -c %Y 3ts_dbtest)
FILE2_TIME=$(stat -c %Y 3ts_dbtest_v2)
TIME_DIFF1=$((BUILD_TIME - FILE1_TIME))
TIME_DIFF2=$((BUILD_TIME - FILE2_TIME))
if [ "$TIME_DIFF1" -lt 300 ]; then echo "3ts_dbtest was updated recently"; else echo "3ts_dbtest was not updated recently"; exit 1; fi
if [ "$TIME_DIFF2" -lt 300 ]; then echo "3ts_dbtest_v2 was updated recently"; else echo "3ts_dbtest_v2 was not updated recently"; exit 1; fi

- name: Run Python test
run: |
set -e
python -c "import certifi; print(certifi.__version__)"
# python ./src/dbtest/src/mda_detect.py
4 changes: 2 additions & 2 deletions src/dbtest/src/mda_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# */


import Queue
import queue
import os
import time

Expand Down Expand Up @@ -563,7 +563,7 @@ def remove_unfinished_operation(data_op_list):
"""
# toposort to determine whether there is a cycle
def check_cycle(edge, indegree, total):
q = Queue.Queue()
q = queue.Queue()
for i, degree in enumerate(indegree):
if degree == 0: q.put(i)
ans = []
Expand Down