Skip to content

Smoke tests

Smoke tests #20

Workflow file for this run

name: Build and Test
on:
push:
branches:
- mock/sdk
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('agent/Dockerfile.*') }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('agent/Dockerfile.*') }}
- name: Build TypeSpec Docker image
uses: docker/build-push-action@v4
with:
context: ./agent
file: ./agent/Dockerfile.typespec
tags: botbuild/tsp_compiler
push: false
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Build Application Docker image
uses: docker/build-push-action@v4
with:
context: ./agent
file: ./agent/Dockerfile.application
tags: botbuild/app_schema
push: false
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Pull PostgreSQL image
run: docker pull postgres:17.0-alpine
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
run: |
uv venv
uv pip install -r agent/requirements.txt
- name: Run tests
env:
DOCKER_HOST: unix:///var/run/docker.sock
run: |
# Give the current user access to docker socket
sudo chmod 666 /var/run/docker.sock
PYTHONPATH=$PYTHONPATH:./agent/ uv run pytest -vs agent/tests
- name: Clean up
if: always()
run: |
docker image prune -f