generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
735 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Setup Cloud Foundy" | ||
description: "Install the Cloud Foundry CLI and login to the AI SDK development space" | ||
|
||
inputs: | ||
username: | ||
description: "The username of a technical user to login to Cloud Foundry" | ||
required: true | ||
password: | ||
description: "The password of a technical user to login to Cloud Foundry" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Cloud Foundry CLI | ||
shell: bash | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | ||
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||
sudo apt-get -qq update | ||
sudo apt-get -qq install cf8-cli | ||
echo "Installed CF CLI in version: $(cf -v)" | ||
- name: Cloud Foundry Login | ||
run: | | ||
cf api https://api.cf.eu12-001.hana.ondemand.com/ | ||
cf login -u ${{ inputs.username }} -p ${{ inputs.password }} | ||
cf target -o 'AI_Core Potsdam_gen-ai-hub-sdk-8pengs8d' -s dev | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: "E2E Test" | ||
on: | ||
push: | ||
branches: | ||
- chore/e2e-test | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 22 * * * | ||
|
||
jobs: | ||
e2e-test: | ||
name: "Build, Deploy and Test" | ||
runs-on: ubuntu-latest | ||
env: | ||
WGET_ARGS: "-qO- -S --content-on-error https://ai-sdk-js-e2e-test.cfapps.eu12-001.hana.ondemand.com" | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: "Setup Node" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: "Setup Cloud Foundry" | ||
uses: ./.github/actions/setup-cloud-foundry | ||
with: | ||
username: ${{ secrets.CF_USERNAME }} | ||
password: ${{ secrets.CF_PASSWORD }} | ||
- name: Create .env file | ||
env: | ||
aicore: ${{ secrets.AIRCORE_ENV_SECRET }} | ||
run: echo "aicore='$aicore'" > .env | ||
- name: "Build" | ||
run: npm install | ||
- name: "Deploy" | ||
run: | | ||
cd sample-code | ||
cf push | ||
- name: "Health Check" | ||
run: | | ||
wget "$WGET_ARGS/" | ||
- name: "OpenAI Chat Completion" | ||
run: | | ||
wget "$WGET_ARGS/llm" | ||
- name: "OpenAI Text Embedding" | ||
run: | | ||
wget "$WGET_ARGS/embedding" | ||
- name: "Stop App" | ||
if: always() | ||
run: | | ||
cf stop e2e-app-js | ||
- name: "Slack Notification" | ||
if: false | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"username": "GitHub E2E Test Runner", | ||
"text": "⚠️ E2E Test Failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-js/actions/runs/${{ github.run_id }}|here>" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
Oops, something went wrong.