Merge pull request #39 from Manarabdelaty/fix_ci

CI updates to get it passing
diff --git a/.github/scripts/precheck/run-precheck-drc.sh b/.github/scripts/precheck/run-precheck-drc.sh
index b13d0ec..dd38dc0 100644
--- a/.github/scripts/precheck/run-precheck-drc.sh
+++ b/.github/scripts/precheck/run-precheck-drc.sh
@@ -17,12 +17,14 @@
 export CARAVEL_ROOT=$(pwd)/caravel
 cd ..
 export PDK_ROOT=$(pwd)/precheck_pdks
+export PRECHECK_ROOT=$TARGET_PATH/mpw_precheck/
+export OUTPUT_DIRECTORY=$TARGET_PATH/checks
 cd $TARGET_PATH/mpw_precheck/
 
-docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT  -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "python3 mpw_precheck.py check magic_drc klayout_offgrid klayout_feol klayout_zeroarea klayout_pin_label_purposes_overlapping_drawing --pdk_root $PDK_ROOT --input_direcoty $TARGET_PATH --caravel_root $CARAVEL_ROOT"
-output=$TARGET_PATH/checks/full_log.log
+docker run -v $PRECHECK_ROOT:$PRECHECK_ROOT -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT  -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "cd $PRECHECK_ROOT; python3 mpw_precheck.py magic_drc klayout_offgrid klayout_feol klayout_zeroarea klayout_pin_label_purposes_overlapping_drawing --pdk_root $PDK_ROOT --input_directory $TARGET_PATH --caravel_root $CARAVEL_ROOT --output_directory $OUTPUT_DIRECTORY"
+output=$OUTPUT_DIRECTORY/logs/precheck.log
 
-gzipped_file=$TARGET_PATH/checks/full_log.log.gz
+gzipped_file=$OUTPUT_DIRECTORY/logs/precheck.log.gz
 
 if [[ -f $gzipped_file ]]; then
     gzip -d $gzipped_file
@@ -30,7 +32,7 @@
 
 grep "Violation Message" $output
 
-cnt=$(grep -c "All Checks PASSED!" $output)
+cnt=$(grep -c "All Checks Passed" $output)
 if ! [[ $cnt ]]; then cnt=0; fi
 if [[ $cnt -eq 1 ]]; then exit 0; fi
 exit 2
\ No newline at end of file
diff --git a/.github/scripts/precheck/run-precheck.sh b/.github/scripts/precheck/run-precheck.sh
index e46a175..66d5da6 100644
--- a/.github/scripts/precheck/run-precheck.sh
+++ b/.github/scripts/precheck/run-precheck.sh
@@ -17,12 +17,14 @@
 export CARAVEL_ROOT=$(pwd)/caravel
 cd ..
 export PDK_ROOT=$(pwd)/precheck_pdks
+export PRECHECK_ROOT=$TARGET_PATH/mpw_precheck/
+export OUTPUT_DIRECTORY=$TARGET_PATH/checks
 cd $TARGET_PATH/mpw_precheck/
 
-docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -v $CARAVEL_ROOT:$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "python3 mpw_precheck.py --pdk_root $PDK_ROOT --input_directory $TARGET_PATH --caravel_root $CARAVEL_ROOT"
-output=$TARGET_PATH/checks/full_log.log
+docker run -v $PRECHECK_ROOT:$PRECHECK_ROOT -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -v $CARAVEL_ROOT:$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c " cd $PRECHECK_ROOT ; python3 mpw_precheck.py license yaml manifest makefile consistency xor --pdk_root $PDK_ROOT --input_directory $TARGET_PATH --caravel_root $CARAVEL_ROOT --output_directory $OUTPUT_DIRECTORY"
+output=$OUTPUT_DIRECTORY/logs/precheck.log
 
-gzipped_file=$TARGET_PATH/checks/full_log.log.gz
+gzipped_file=$OUTPUT_DIRECTORY/logs/precheck.log.gz
 
 if [[ -f $gzipped_file ]]; then
     gzip -d $gzipped_file
@@ -30,7 +32,7 @@
 
 grep "Violation Message" $output
 
-cnt=$(grep -c "All Checks PASSED!" $output)
+cnt=$(grep -c "All Checks Passed" $output)
 if ! [[ $cnt ]]; then cnt=0; fi
 if [[ $cnt -eq 1 ]]; then exit 0; fi
 exit 2
diff --git a/.github/workflows/caravel_build.yml b/.github/workflows/caravel_build.yml
index f86ab79..c615662 100644
--- a/.github/workflows/caravel_build.yml
+++ b/.github/workflows/caravel_build.yml
@@ -6,6 +6,7 @@
     push:
     # Runs on Pull Requests
     pull_request:
+    workflow_dispatch:
 
 jobs:
   make_ship:
@@ -24,12 +25,12 @@
        - name: Install The PDK
          run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG:  2021.09.16_03.28.21
 
        - name: Run make ship
          run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-ship.sh 
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG:  2021.09.16_03.28.21
           
   set_user_id:
     runs-on: ubuntu-latest
@@ -47,12 +48,12 @@
        - name: Install The PDK
          run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG:  2021.09.16_03.28.21
 
        - name: Run Set User ID
          run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-set-id.sh 
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG:  2021.09.16_03.28.21
 
   xor_wrapper:
     runs-on: ubuntu-latest
@@ -70,9 +71,9 @@
        - name: Install The PDK
          run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG: 2021.09.16_03.28.21
 
        - name: Run XOR Check
          run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-xor.sh 
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG:  2021.09.16_03.28.21
diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml
index 4723ed5..5b8ea91 100644
--- a/.github/workflows/user_project_ci.yml
+++ b/.github/workflows/user_project_ci.yml
@@ -1,4 +1,4 @@
-name: UPRJ_CI
+name: CI
 
 
 on:
@@ -6,6 +6,7 @@
     push:
     # Runs on Pull Requests
     pull_request:
+    workflow_dispatch:
 
 jobs:
   precheck:
@@ -64,7 +65,7 @@
        - name: Install The PDK
          run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
          env: 
-          OPENLANE_TAG: v0.12
+          OPENLANE_TAG: 2021.09.16_03.28.21
           
        - name: Install The Dockerized DV Setup
          run:  docker pull efabless/dv_setup:latest
@@ -73,27 +74,27 @@
          # Run test number 0,1,2,3,4 in one job                            <test-ids>   <sim-mode>
          run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-wrapper.sh 0,1,2,3,4      RTL
 
-  # dv_gl:
-  #   runs-on: ubuntu-latest
-  #   steps:
-  #      - uses: actions/checkout@v2
-  #        with:
-  #         submodules: 'true'
+  dv_gl:
+    runs-on: ubuntu-latest
+    steps:
+       - uses: actions/checkout@v2
+         with:
+          submodules: 'true'
       
-  #      - name: Set up QEMU
-  #        uses: docker/setup-qemu-action@v1
+       - name: Set up QEMU
+         uses: docker/setup-qemu-action@v1
 
-  #      - name: Set up Docker Buildx
-  #        uses: docker/setup-buildx-action@v1
+       - name: Set up Docker Buildx
+         uses: docker/setup-buildx-action@v1
         
-  #      - name: Install The PDK
-  #        run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
-  #        env: 
-  #         OPENLANE_TAG: v0.12
+       - name: Install The PDK
+         run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
+         env: 
+          OPENLANE_TAG: 2021.09.16_03.28.21
           
-  #      - name: Install The Dockerized DV Setup
-  #        run:  docker pull efabless/dv_setup:latest
+       - name: Install The Dockerized DV Setup
+         run:  docker pull efabless/dv_setup:latest
        
-  #      - name: Run DV tests
-  #        # Run test number 0,1,2,3,4 in one job                             <test-ids>   <sim-mode>
-  #        run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-wrapper.sh 0,1,2,3,4      GL
\ No newline at end of file
+       - name: Run DV tests
+         # Run test number 0,1,2,3,4 in one job                             <test-ids>   <sim-mode>
+         run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-wrapper.sh 0,1,2,3,4      GL
\ No newline at end of file