-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcheck-pr-against-other-branch.yml
More file actions
99 lines (89 loc) · 4.07 KB
/
check-pr-against-other-branch.yml
File metadata and controls
99 lines (89 loc) · 4.07 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Check PR against another branch
on:
workflow_call:
inputs:
pr_num:
description: The PR Number
required: true
type: string
base_branch:
description: The base branch to check against
type: string
default: 'main'
java_version:
description: The Java version
type: string
default: '21'
ai_provider:
description: The AI provider to use
required: true
type: string
defaults:
run:
shell: bash
jobs:
check-pr-against-other-branch:
runs-on: ubuntu-latest
name: "check-${{ inputs.base_branch }}-${{ inputs.java_version }}"
services:
ollama:
image: ollama/ollama
ports:
- 11434:11434
options: --name ollama --rm
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.base_branch }}
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: "build-test-jvm-java${{ matrix.java }}-${{ matrix.ai-provider }}"
if: inputs.ai_provider != 'openai'
working-directory: src/app
run: |
./mvnw -B clean verify \
-P${{ inputs.ai_provider }} \
-Dquarkus.http.host=0.0.0.0 \
-Dmaven.compiler.release=${{ inputs.java_version }}
# - name: Install Playwright dependencies
# run: |
# sudo apt-get install \
# libwoff1 \
# libvpx9 \
# libevent-2.1-7t64 \
# libopus0 \
# libgstreamer-plugins-base1.0-0 \
# libgstreamer-gl1.0-0 \
# libgstreamer-plugins-bad1.0-0 \
# libharfbuzz-icu0 \
# libsecret-1-0 \
# libhyphen0 \
# libmanette-0.2-0 \
# libflite1 \
# libgles2 \
# gstreamer1.0-libav
- name: "build-test-jvm-java${{ matrix.java }}-${{ matrix.ai-provider }}"
if: inputs.ai_provider == 'openai'
working-directory: src/app
run: |
docker exec ollama bash -c "ollama pull llama3.2 && ollama pull snowflake-arctic-embed && ollama ls"
./mvnw -B clean verify \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.langchain4j.openai.base-url=http://localhost:11434/v1 \
-Dquarkus.langchain4j.openai.parasol-chat.base-url=http://localhost:11434/v1 \
-Dquarkus.langchain4j.openai.parasol-chat.chat-model.model-name=llama3.2 \
-Dquarkus.langchain4j.openai.embedding-model.model-name=snowflake-arctic-embed \
-Dmaven.compiler.release=${{ inputs.java_version }}