diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..24454c45 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/dbtest/src/mda_detect.py b/src/dbtest/src/mda_detect.py index 982361ea..76405b2d 100644 --- a/src/dbtest/src/mda_detect.py +++ b/src/dbtest/src/mda_detect.py @@ -10,7 +10,7 @@ # */ -import Queue +import queue import os import time @@ -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 = []