test(examples): update script #6
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: E2E Examples | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "**/*.md" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Tests | |
timeout-minutes: 40 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Install ollama | |
run: curl -fsSL https://ollama.com/install.sh | sh | |
- name: Run ollama | |
run: | | |
ollama serve & | |
ollama pull llama3.1 | |
- name: Call ollama API | |
run: | | |
curl -d '{"model": "llama3.1:latest", "stream": false, "prompt":"Whatever I say, asnwer with Yes"}' http://localhost:11434/api/generate | |
- name: Example Tests | |
env: | |
GENAI_API_KEY: ${{ secrets.GENAI_API_KEY }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
# TODO: enable WatsonX later | |
# WATSONX_API_KEY: ${{ secrets.WATSONX_API_KEY }} | |
# WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }} | |
# WATSONX_SPACE_ID: ${{ secrets.WATSONX_SPACE_ID }} | |
# WATSONX_DEPLOYMENT_ID: ${{ secrets.WATSONX_DEPLOYMENT_ID }} | |
shell: bash | |
run: | | |
yarn test:examples |