From 9291128514787a0aad7cfe7961a3303649f1407f Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Thu, 2 Jul 2020 08:28:02 +0200 Subject: [PATCH] Improved Maven Workflow Maven dependencies are now cached for faster build times. The cache is discarded once the pom.xml is updated. The JAR files generated during the build are made available as workflow artifacts. --- .github/workflows/maven.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index da5f736..e9f97db 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,14 +4,25 @@ on: [push] jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 - name: Build with Maven run: mvn -B package --file pom.xml + - name: Stage build artifacts + run: mkdir staging && cp target/*.jar staging + - uses: actions/upload-artifact@v1 + with: + name: envoy-client-artifacts + path: staging