mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-04-26 10:01:30 -04:00
60 lines
2.3 KiB
YAML
60 lines
2.3 KiB
YAML
name: CI
|
|
on:
|
|
workflow_call:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
env:
|
|
PAPERSPACE_API_KEY: ${{secrets.PAPERSPACE_API_KEY}}
|
|
defaults:
|
|
run:
|
|
shell: bash --noprofile --norc -exo 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@a5ac7e51b41094c92402da3b24376905380afc29 # 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
|
|
- name: startup machine
|
|
run: python tools/machines.py --start ${{ secrets.PAPERSPACE_MACHINE_ID }} || true
|
|
- 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: ${{secrets.PAPERSPACE_HOST}}
|
|
username: ${{secrets.PAPERSPACE_USERNAME}}
|
|
key: ${{secrets.PAPERSPACE_SSH_KEY}}
|
|
port: ${{secrets.PAPERSPACE_PORT}}
|
|
script: bash ci.sh --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: ${{secrets.PAPERSPACE_HOST}}
|
|
username: ${{secrets.PAPERSPACE_USERNAME}}
|
|
key: ${{secrets.PAPERSPACE_SSH_KEY}}
|
|
port: ${{secrets.PAPERSPACE_PORT}}
|
|
script: bash ci.sh --head
|
|
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) }}
|