I'm trying to make a Github Action that runs a "make check" step. If it succeeds, it should archive the test log as an artifact and continue to the next step. If it fails, it should upload the test log as an artifact then stop.
What I have is
jobs:
build:
steps:
# Then a bunch of steps to download Cygwin and run autoconf and make, then...
- name: make check
run: make check
shell: C:\cygwin\bin\bash.exe -o igncr '{0}'
- name: Archive test logs
uses: actions/upload-artifact@v3
with:
name: logs
path: test.log
- name: make install
run: make install
shell: C:\cygwin\bin\bash.exe -o igncr '{0}'
Whether "make check" succeeds or fails, I'd like "Archive test logs" to run. But then "make install" shouldn't run if "make check" failed.
I did try adding 'continue-on-error: true' to the 'make check' step so that it always runs the "Archive test logs" step, which works. But then it runs 'make install' unnecessarily