Skip to content

chore: Unify all SDKs to the inferable monorepo #2

chore: Unify all SDKs to the inferable monorepo

chore: Unify all SDKs to the inferable monorepo #2

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-node:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk-node
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
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: build-node
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
defaults:
run:
working-directory: sdk-node
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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_API_ENDPOINT: "https://api.inferable.ai"
INFERABLE_CLUSTER_ID: ${{ secrets.INFERABLE_CLUSTER_ID }}
INFERABLE_MACHINE_SECRET: ${{ secrets.INFERABLE_MACHINE_SECRET }}
INFERABLE_CONSUME_SECRET: ${{ secrets.INFERABLE_CONSUME_SECRET }}
build-dotnet:
runs-on: windows-latest
defaults:
run:
working-directory: sdk-dotnet
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
test-dotnet:
needs: build-dotnet
runs-on: windows-latest
defaults:
run:
working-directory: sdk-dotnet
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Restore dependencies
run: dotnet restore
- name: Test
run: dotnet test --no-restore
env:
INFERABLE_API_ENDPOINT: "https://api.inferable.ai"
INFERABLE_CLUSTER_ID: ${{ secrets.INFERABLE_CLUSTER_ID }}
INFERABLE_MACHINE_SECRET: ${{ secrets.INFERABLE_MACHINE_SECRET }}
INFERABLE_CONSUME_SECRET: ${{ secrets.INFERABLE_CONSUME_SECRET }}
build-go:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk-go
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Get dependencies
run: go mod download
- name: Build
run: go build -v ./...
test-go:
needs: build-go
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk-go
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Get dependencies
run: go mod download
- name: Test
run: go test -v ./...
env:
INFERABLE_API_ENDPOINT: "https://api.inferable.ai"
INFERABLE_CLUSTER_ID: ${{ secrets.INFERABLE_CLUSTER_ID }}
INFERABLE_MACHINE_SECRET: ${{ secrets.INFERABLE_MACHINE_SECRET }}
INFERABLE_CONSUME_SECRET: ${{ secrets.INFERABLE_CONSUME_SECRET }}