Simplify Github actions

Consolidate build steps to 1 script this way we don't run multiple builds for pushing a branch and create a PR.
This commit is contained in:
Nanne Baars
2021-10-23 21:12:28 +02:00
committed by Nanne Baars
parent eb163c8df1
commit 01d3453c41
3 changed files with 9 additions and 59 deletions

View File

@@ -1,52 +0,0 @@
name: "Branch build"
on:
push:
branches-ignore:
- master
- develop
- release/*
jobs:
install-notest:
runs-on: ubuntu-latest
name: "Package and linting"
steps:
- uses: actions/checkout@v2
- name: set up JDK 16
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 16
architecture: x64
- name: Cache Maven packages
uses: actions/cache@v2.1.5
with:
path: ~/.m2
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ubuntu-latest-m2
- name: Test with Maven
run: mvn install -DskipTests
testing:
needs: install-notest
runs-on: ubuntu-latest
strategy:
matrix:
args:
- mvn -pl '!webgoat-integration-tests' test
- mvn -pl webgoat-integration-tests test
steps:
- uses: actions/checkout@v2
- name: set up JDK 16
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 16
architecture: x64
- name: Cache Maven packages
uses: actions/cache@v2.1.5
with:
path: ~/.m2
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ubuntu-latest-m2
- name: Test with Maven
run: ${{ matrix.args }}