Cleaned up pom, added simple quality test action on push usable for forks of the repo

This commit is contained in:
Jeroen Willemsen 2021-09-29 09:40:45 +02:00 committed by Nanne Baars
parent 0c285eef5b
commit 9403bbb851
6 changed files with 58 additions and 8 deletions

View File

@ -46,12 +46,12 @@ jobs:
run: mvn clean install
notify-slack:
if: github.event_name == 'push' && (success() || failure())
if: github.repository == 'WebGoat/WebGoat' && github.event_name == 'push' && (success() || failure())
needs:
- build
runs-on: ubuntu-latest
steps:
- name: "Slack workflow notification"
- name: "Slack workflow notification fork test"
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}

52
.github/workflows/quality_checks.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: "Testing and linting"
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 15
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 15
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 clean 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 15
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 15
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 }}

View File

@ -5,7 +5,7 @@ on:
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER'
if: github.repository == 'WebGoat/WebGoat' && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER'
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code

View File

@ -5,6 +5,7 @@ on:
- v*
jobs:
release:
if: github.repository == 'WebGoat/WebGoat'
name: Release WebGoat
runs-on: ubuntu-latest
environment:
@ -103,6 +104,7 @@ jobs:
- name: "Image digest"
run: echo ${{ steps.docker_build.outputs.digest }}
new_version:
if: github.repository == 'WebGoat/WebGoat'
name: Update development version
needs: [ release ]
runs-on: ubuntu-latest

View File

@ -7,6 +7,7 @@ on:
jobs:
greeting:
if: github.repository == 'WebGoat/WebGoat'
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1.1.0

View File

@ -110,11 +110,6 @@
<url>https://github.com/WebGoat/WebGoat/issues</url>
</issueManagement>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.org/WebGoat/WebGoat</url>
</ciManagement>
<properties>
<!-- Use UTF-8 Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>