From 1a722d89dfc265861a99e1f9a4ccee9b4888147e Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Thu, 27 Apr 2023 12:50:26 +0200 Subject: [PATCH] Upload failed tests workspaces to artifacts in GitHub CI --- .github/workflows/haskell-linux.yml | 16 ++++++++++++++++ .github/workflows/haskell.yml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/haskell-linux.yml b/.github/workflows/haskell-linux.yml index d4ff43bf91d..b5538dd197d 100644 --- a/.github/workflows/haskell-linux.yml +++ b/.github/workflows/haskell-linux.yml @@ -158,6 +158,22 @@ jobs: KEEP_WORKSPACE: 1 run: cabal test cardano-testnet cardano-api cardano-node cardano-node-chairman cardano-cli cardano-submit-api + - name: Tar failed tests workspaces + if: ${{ failure() }} + env: + TMP: ${{ runner.temp }} + shell: bash + run: | + cd $TMP + find . -name 'module' -type f -printf '%h\n' | xargs -L1 basename | sort -u | xargs tar -czvf workspaces.tgz + + - name: Upload workspaces on tests failure + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: failed-test-workspaces-${{ matrix.os }}-ghc${{ matrix.ghc }}-cabal${{ matrix.cabal }}.tgz + path: ${{ runner.temp }}/workspaces.tgz + - name: "Tar artifacts" shell: bash run: | diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index e3c7e44d7a6..e936e10355d 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -187,6 +187,22 @@ jobs: ${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }} cabal test cardano-testnet cardano-api cardano-node cardano-node-chairman cardano-cli cardano-submit-api + - name: Tar failed tests workspaces + if: ${{ failure() }} + env: + TMP: ${{ runner.temp }} + shell: bash + run: | + cd $TMP + find . -name 'module' -type f -printf '%h\n' | xargs -L1 basename | sort -u | xargs tar -czvf workspaces.tgz + + - name: Upload workspaces on tests failure + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: failed-test-workspaces-${{ matrix.os }}-ghc${{ matrix.ghc }}-cabal${{ matrix.cabal }}.tgz + path: ${{ runner.temp }}/workspaces.tgz + - name: "Tar artifacts" shell: bash run: |