-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.4 KB
/
check-against-solution.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Check PR against solution branch
on:
workflow_call:
inputs:
pr_num:
description: The PR Number
required: true
type: string
java_version:
description: The Java version
required: true
type: string
default: '17'
defaults:
run:
shell: bash
jobs:
check-commit-against-solution-branch:
runs-on: ubuntu-latest
if: github.repository == 'RedHat-Middleware-Workshops/spring-jkube-external-config'
name: "check-commit-against-solution-branch-${{ inputs.java_version }}"
steps:
- uses: actions/checkout@v4
with:
ref: solution
path: src
- name: Get PR diff
run: wget ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/${{ inputs.pr_num }}.diff
- name: Apply change
working-directory: src
run: git apply --stat -v --ignore-whitespace --allow-empty --apply ../${{ inputs.pr_num }}.diff
- name: Show diff
working-directory: src
run: git status && git diff
- name: Setup Java ${{ inputs.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version }}
distribution: temurin
cache: maven
- name: Run build and tests with Java ${{ inputs.java_version }}
working-directory: src
run: ./mvnw -B clean verify -Dmaven.compiler.release=${{ inputs.java_version }}