Skip to content

Commit

Permalink
Upload failed tests workspaces to artifacts in GitHub CI
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed May 2, 2023
1 parent 3a2413a commit 1a722d8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/haskell-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 1a722d8

Please sign in to comment.