diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a95db618..894cbd55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,17 @@ jobs: - name: SCMOS test run: | . /home/github-runner/setup-paths.sh - export OPENRAM_HOME="`pwd`/compiler" - export OPENRAM_TECH="`pwd`/technology:/software/PDKs/skywater-tech" + export OPENRAM_HOME="${{ github.workspace }}/compiler" + export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" export OPENRAM_TMP="${{ github.workspace }}/scn4me_subm_temp" #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t scn4m_subm $OPENRAM_HOME/tests/regress.py -j 16 -t scn4m_subm - # - name: Archive - # if: ${{ failure() }} - # uses: actions/upload-artifact@v2 - # with: - # name: scn4me_subm Archives - # path: ${{ github.workspace }}/scn4me_subm_temp/ + - name: Archive + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: scn4me_subm Archives + path: ${{ github.workspace }}/*.zip freepdk45: runs-on: self-hosted steps: @@ -28,17 +28,17 @@ jobs: - name: FreePDK45 test run: | . /home/github-runner/setup-paths.sh - export OPENRAM_HOME="`pwd`/compiler" - export OPENRAM_TECH="`pwd`/technology:/software/PDKs/skywater-tech" + export OPENRAM_HOME="${{ github.workspace }}/compiler" + export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" export OPENRAM_TMP="${{ github.workspace }}/freepdk45_temp" #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t freepdk45 $OPENRAM_HOME/tests/regress.py -j 16 -t freepdk45 - # - name: Archive - # if: ${{ failure() }} - # uses: actions/upload-artifact@v2 - # with: - # name: FreePDK45 Archives - # path: ${{ github.workspace }}/freepdk45_temp/ + - name: Archive + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: FreePDK45 Archives + path: ${{ github.workspace }}/*.zip # coverage_stats: # if: ${{ always() }} # needs: [scn4me_subm, freepdk45] diff --git a/compiler/tests/testutils.py b/compiler/tests/testutils.py index 4d8bf573..ed24f8cf 100644 --- a/compiler/tests/testutils.py +++ b/compiler/tests/testutils.py @@ -17,6 +17,23 @@ import traceback class openram_test(unittest.TestCase): """ Base unit test that we have some shared classes in. """ + def fail(self, msg): + import inspect + s = inspect.stack() + base_filename = os.path.splitext(os.path.basename(s[2].filename))[0] + + try: + OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME")) + except: + debug.error("$OPENRAM_HOME is not properly defined.", 1) + + import shutil + zip_file = "{0}/../{1}_{2}".format(OPENRAM_HOME, base_filename, os.getpid()) + debug.info(0, "Archiving failed temp files {0} to {1}".format(OPTS.openram_temp, zip_file)) + shutil.make_archive(zip_file, 'zip', OPTS.openram_temp) + + super().fail(msg) + def local_drc_check(self, w): self.reset()