-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 2.89 KB
/
java-ci.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
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
name: Java CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ollama-e2e:
runs-on: ubuntu-22.04
name: ollama-e2e
steps:
- uses: actions/checkout@v1
- uses: self-actuated/nvidia-run@master
- name: Install Ollama
run: |
curl -fsSL https://ollama.com/install.sh | sudo -E sh
- name: Start serving
run: |
# Run the background, there is no way to daemonise at the moment
ollama serve &
# A short pause is required before the HTTP port is opened
sleep 5
# This endpoint blocks until ready
time curl -i http://localhost:11434
- name: Pull llama3
run: |
ollama pull llama3
#- name: Invoke via the CLI
# run: |
# ollama run llama2 "What are the pros of MicroVMs for continous integrations, especially if Docker is the alternative?"
#- name: Invoke via API
# run: |
# curl -s http://localhost:11434/api/generate -d '{
# "model": "llama2",
# "stream": false,
# "prompt":"What are the risks of running privileged Docker containers for CI workloads?"
# }' | jq
build:
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ '8', '11', '17']
name: JDK ${{ matrix.Java }} build
steps:
- uses: actions/[email protected]
- name: Set up Java
uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
cache: gradle
- name: Before Script
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && chmod +x ./cc-test-reporter && ./cc-test-reporter before-build
- name: Validate Gradle wrapper
uses: gradle/[email protected]
- name: Build with Gradle headless
uses: coactions/[email protected]
with:
run: ./gradlew clean build jacocoTestReport
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Test & publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: e725fad6a6a0b7580271e8183ad773ff705a3b33c5d3a588b940b4f00fa85e69
JACOCO_SOURCE_PATH: "${{github.workspace}}/src/main/java"
with:
coverageLocations: ${{github.workspace}}/build/reports/jacoco/test/jacocoTestReport.xml:jacoco