chore(deps-dev): Bump promptfoo from 0.81.5 to 0.99.0 in /sdk-node #410
Workflow file for this run
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: Build and Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_changes: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
outputs: | |
sdk_node: ${{ steps.filter.outputs.sdk_node }} | |
sdk_dotnet: ${{ steps.filter.outputs.sdk_dotnet }} | |
sdk_go: ${{ steps.filter.outputs.sdk_go }} | |
sdk_react: ${{ steps.filter.outputs.sdk_react }} | |
cli: ${{ steps.filter.outputs.cli }} | |
control_plane: ${{ steps.filter.outputs.control_plane }} | |
app: ${{ steps.filter.outputs.app }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Filter changed files | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
sdk_node: | |
- 'sdk-node/**' | |
sdk_dotnet: | |
- 'sdk-dotnet/**' | |
sdk_go: | |
- 'sdk-go/**' | |
sdk_react: | |
- 'sdk-react/**' | |
cli: | |
- 'cli/**' | |
control_plane: | |
- 'control-plane/**' | |
app: | |
- 'app/**' | |
build-control-plane: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.control_plane == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: control-plane | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: control-plane/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
test-control-plane: | |
runs-on: ubuntu-latest | |
needs: [check_changes, build-control-plane] | |
if: ${{ needs.check_changes.outputs.control_plane == 'true' }} | |
defaults: | |
run: | |
working-directory: control-plane | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
postgres: | |
image: pgvector/pgvector:pg16 | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: control-plane/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: | | |
set -eo pipefail | |
npm run test | |
if [[ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]]; then | |
npm run test:ai | |
fi | |
env: | |
REDIS_URL: "redis://localhost:6379" | |
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" | |
DATABASE_SSL_DISABLED: "1" | |
JWKS_URL: ${{ secrets.TEST_JWKS_URL }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: "ap-southeast-2" | |
BEDROCK_AVAILABLE: "true" | |
SQS_RUN_PROCESS_QUEUE_URL: "PLACEHOLDER" | |
SQS_RUN_GENERATE_NAME_QUEUE_URL: "PLACEHOLDER" | |
SQS_LEARNING_INGEST_QUEUE_URL: "PLACEHOLDER" | |
SQS_CUSTOMER_TELEMETRY_QUEUE_URL: "PLACEHOLDER" | |
SQS_EXTERNAL_TOOL_CALL_QUEUE_URL: "PLACEHOLDER" | |
build-app: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.app == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: app | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: app/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
env: | |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} | |
build-node: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.sdk_node == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-node | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: sdk-node/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
test-node: | |
needs: [check_changes, build-node] | |
if: ${{ needs.check_changes.outputs.sdk_node == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-node | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: sdk-node/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
env: | |
INFERABLE_TEST_API_ENDPOINT: "https://api.inferable.ai" | |
INFERABLE_TEST_CLUSTER_ID: ${{ secrets.INFERABLE_TEST_CLUSTER_ID }} | |
INFERABLE_TEST_API_SECRET: ${{ secrets.INFERABLE_TEST_API_SECRET }} | |
build-cli: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.cli == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: cli | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: cli/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
test-cli: | |
needs: [check_changes, build-cli] | |
if: ${{ needs.check_changes.outputs.cli == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: cli | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: cli/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
build-dotnet: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.sdk_dotnet == 'true' }} | |
runs-on: windows-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-dotnet | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
test-dotnet: | |
needs: [check_changes, build-dotnet] | |
if: ${{ needs.check_changes.outputs.sdk_dotnet == 'true' }} | |
runs-on: windows-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-dotnet | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Test | |
run: dotnet test --no-restore | |
env: | |
INFERABLE_TEST_API_ENDPOINT: "https://api.inferable.ai" | |
INFERABLE_TEST_CLUSTER_ID: ${{ secrets.INFERABLE_TEST_CLUSTER_ID }} | |
INFERABLE_TEST_API_SECRET: ${{ secrets.INFERABLE_TEST_API_SECRET }} | |
build-go: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.sdk_go == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-go | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Check formatting | |
run: | | |
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then | |
echo "The following files are not formatted correctly:" | |
gofmt -l . | |
exit 1 | |
fi | |
- name: Get dependencies | |
run: go mod download | |
- name: Build | |
run: go build -v ./... | |
test-go: | |
needs: [check_changes, build-go] | |
if: ${{ needs.check_changes.outputs.sdk_go == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-go | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- name: Get dependencies | |
run: go mod download | |
- name: Test | |
run: go test -v ./... | |
env: | |
INFERABLE_TEST_API_ENDPOINT: "https://api.inferable.ai" | |
INFERABLE_TEST_CLUSTER_ID: ${{ secrets.INFERABLE_TEST_CLUSTER_ID }} | |
INFERABLE_TEST_API_SECRET: ${{ secrets.INFERABLE_TEST_API_SECRET }} | |
build-react: | |
needs: check_changes | |
if: ${{ needs.check_changes.outputs.sdk_react == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-react | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: sdk-react/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
test-react: | |
needs: [check_changes, build-react] | |
if: ${{ needs.check_changes.outputs.sdk_react == 'true' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: sdk-react | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: sdk-react/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test |