netty-incubator-buffer-api/.github/workflows/ci-workflow.yml
Chris Vest 0db6a745dc Always attach test results to PR builds
Previously the test results were only attached to passing builds, which is, like, the opposite of useful.

Also finally figured out how to nerf the local docker layer cache.
Recorded this new knowledge as make commands.
2021-04-27 15:06:43 +02:00

60 lines
1.9 KiB
YAML

name: CI Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '30 6 * * 1' # At 06:30 on Monday, every Monday.
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# http://man7.org/linux/man-pages/man1/date.1.html
- name: Create Cache Key
id: cache-key
run: |
echo "::set-output name=key::$(/bin/date -u "+%Y%U")"
shell: bash
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: docker-cache-${{ steps.cache-key.outputs.key }}-{hash}
restore-keys: |
docker-cache-${{ steps.cache-key.outputs.key }}-
# Run the make script
- name: Make build
run: make build
- name: Publish Test Report
uses: scacap/action-surefire-report@v1.0.9
if: ${{ always() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/target/surefire-reports/TEST-*.xml'
commit: ${{ github.event.workflow_run.head_commit.id }}
check_name: Build test reports
- name: Upload build artefacts
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: artifacts
path: target/