mirror of
https://github.com/langgenius/dify.git
synced 2026-07-20 09:38:32 +08:00
99 lines
2.6 KiB
YAML
99 lines
2.6 KiB
YAML
name: Sandbox Runtime Tests
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: sandbox-runtime-tests-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
sandbox-runtime-unit:
|
|
name: Sandbox Runtime Unit Tests
|
|
runs-on: depot-ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: dify-agent-runtime
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version-file: dify-agent-runtime/go.mod
|
|
cache-dependency-path: dify-agent-runtime/go.sum
|
|
|
|
- name: Run unit tests
|
|
run: go test -race -count=1 ./...
|
|
|
|
sandbox-runtime-lint:
|
|
name: Sandbox Runtime Lint
|
|
runs-on: depot-ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: dify-agent-runtime
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version-file: dify-agent-runtime/go.mod
|
|
cache-dependency-path: dify-agent-runtime/go.sum
|
|
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v6.5.0
|
|
with:
|
|
working-directory: dify-agent-runtime
|
|
version: latest
|
|
|
|
sandbox-runtime-integration:
|
|
name: Sandbox Runtime Integration Tests
|
|
runs-on: depot-ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: dify-agent-runtime
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version-file: dify-agent-runtime/go.mod
|
|
cache-dependency-path: dify-agent-runtime/go.sum
|
|
|
|
- name: Build and start runtime
|
|
run: make integration-up
|
|
|
|
- name: Run integration tests
|
|
run: make integration-test
|
|
|
|
- name: Dump container logs on failure
|
|
if: failure()
|
|
run: make integration-logs || true
|
|
|
|
- name: Stop runtime container
|
|
if: always()
|
|
run: make integration-down
|