mirror of
https://github.com/bentoml/OpenLLM.git
synced 2025-12-23 23:57:46 -05:00
72 lines
3.1 KiB
YAML
72 lines
3.1 KiB
YAML
name: CI
|
|
on:
|
|
workflow_call:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
env:
|
|
PAPERSPACE_API_KEY: ${{secrets.PAPERSPACE_API_KEY}}
|
|
PAPERSPACE_NETWORK_ID: ${{secrets.PAPERSPACE_NETWORK_ID}}
|
|
defaults:
|
|
run:
|
|
shell: bash --noprofile --norc -eo pipefail {0}
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push'|| github.event_name == 'workflow_call' }}
|
|
name: General API tests
|
|
steps:
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # ratchet:actions/checkout@v4
|
|
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # ratchet:actions/setup-python@v5
|
|
with:
|
|
python-version-file: '.python-version-default'
|
|
- name: setup tooling
|
|
run: |
|
|
python -m pip install uv
|
|
uv pip install --system httpx orjson
|
|
- name: startup machine
|
|
id: paperspace-machine
|
|
run: |
|
|
PUBLIC_IP=$(python tools/machines.py --ci-template ${{secrets.PAPERSPACE_TEMPLATE_ID}} --output-ip)
|
|
MACHINE_ID=$(python tools/machines.py --ci-template ${{secrets.PAPERSPACE_TEMPLATE_ID}} --output-id)
|
|
echo "::add-mask::$PUBLIC_IP"
|
|
echo "::add-mask::$MACHINE_ID"
|
|
echo "publicIp=$PUBLIC_IP" >> $GITHUB_OUTPUT
|
|
echo "machineId=$MACHINE_ID" >> $GITHUB_OUTPUT
|
|
- name: running regression tests (PR)
|
|
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # ratchet:appleboy/ssh-action@v1.0.3
|
|
if: github.event_name == 'pull_request'
|
|
with:
|
|
host: ${{ steps.paperspace-machine.outputs.publicIp }}
|
|
username: paperspace
|
|
key: ${{ secrets.PAPERSPACE_SSH_KEY }}
|
|
port: ${{ secrets.PAPERSPACE_PORT }}
|
|
command_timeout: 1h
|
|
script: /nix/var/nix/profiles/default/bin/nix run github:aarnphm/dix#openllm-ci --refresh -- --pr ${{github.event.number}}
|
|
- name: running regression tests (main)
|
|
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # ratchet:appleboy/ssh-action@v1.0.3
|
|
if: ${{ !github.event.repository.fork && github.event_name == 'push' }}
|
|
with:
|
|
host: ${{ steps.paperspace-machine.outputs.publicIp }}
|
|
username: paperspace
|
|
key: ${{ secrets.PAPERSPACE_SSH_KEY }}
|
|
port: ${{ secrets.PAPERSPACE_PORT }}
|
|
command_timeout: 1h
|
|
script: /nix/var/nix/profiles/default/bin/nix run github:aarnphm/dix#openllm-ci --accept-flake-config --refresh -- --head
|
|
- name: shutdown machine
|
|
run: python tools/machines.py --delete ${{ steps.paperspace-machine.outputs.machineId }}
|
|
evergreen: # https://github.com/marketplace/actions/alls-green#why
|
|
if: always()
|
|
needs:
|
|
- tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # ratchet:re-actors/alls-green@release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|