morganstanley / hobbes

A language and an embedded JIT compiler
http://hobbes.readthedocs.io/
Apache License 2.0
1.16k stars 105 forks source link

fix missing nix logs when build fail #409

Closed mo-xiaoming closed 3 years ago

mo-xiaoming commented 3 years ago

When git action failed, there is no log artifact uploaded

      - name: nix build hobbesPackages/clang-${{ matrix.clang }}/hobbes
        run: |
          nix build .#hobbesPackages/clang-${{ matrix.clang }}/hobbes
          nix log  .#hobbesPackages/clang-${{ matrix.clang }}/hobbes &> ${{ matrix.os }}-clang-${{ matrix.clang }}-hobbes.log
      - name: upload log ${{ matrix.os }}-clang-${{ matrix.clang }}-hobbes.log

If things go wrong during nix build, the whole process will be aborted and both nix log and next step upload log will never get executed

By splitting two nix commands and adding if ${{ always() }} to force the execution, log will be uploaded no matter what.

Not sure is this the right way of doing it