Open ai #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |