java-sdk/.github/workflows/pullrequest.yml

52 lines
1.5 KiB
YAML

name: PR
on:
pull_request:
branches: [ master, main ]
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure GPG Key
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Build with Maven
run: |
if [ ${{ github.event.pull_request.head.repo.full_name }} = ${{ github.repository }} ]; then
mvn --batch-mode --update-snapshots verify
else
mvn --batch-mode --update-snapshots verify -Dgpg.skip
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: unittests # optional
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)