Capture build artifacts for failed builds

Motivation:
When a build fails, it's desirable to have the build artifacts available
so the build failure can be inspected, investigated and hopefully fixed.

Modification:
Change the Makefile and CI workflow such that the build artifacts are
captured and uploaded when the build fails.

Result:
A "target.zip" file is now available for download on failed GitHub
Actions builds.
This commit is contained in:
Chris Vest 2020-11-30 13:49:25 +01:00
parent e039f6f7f5
commit e3c7f9b632
3 changed files with 9 additions and 4 deletions

View File

@ -43,3 +43,9 @@ jobs:
# Run the make script
- name: Make build
run: make build
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: target
path: target/ # or path/to/artifact

View File

@ -17,7 +17,7 @@ clean:
build: image
docker create --name build-container netty-incubator-buffer:build
docker start -a build-container
docker wait build-container
docker start -a build-container || (docker cp build-container:/home/build/target . && false)
docker wait build-container || (docker cp build-container:/home/build/target . && false)
docker cp build-container:/home/build/target .
docker rm build-container

View File

@ -27,8 +27,7 @@ final class CompositeBuf extends RcSupport<Buf, CompositeBuf> implements Buf {
* non-composite copy of the buffer.
*/
private static final int MAX_CAPACITY = Integer.MAX_VALUE - 8;
private static final Drop<CompositeBuf>
COMPOSITE_DROP = new Drop<CompositeBuf>() {
private static final Drop<CompositeBuf> COMPOSITE_DROP = new Drop<CompositeBuf>() {
@Override
public void drop(CompositeBuf obj) {
for (Buf buf : obj.bufs) {