Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN corepack use pnpm@*

ARG WORKDIR=/chatbot_server
WORKDIR ${WORKDIR}
COPY scripts/ ${WORKDIR}/scripts/

# Adding package.json first will cache our dependencies so
# that they do not have to be re-installed when the image rebuilds
Expand All @@ -20,6 +21,7 @@ COPY . .
RUN chmod +x ./scripts/*.sh || true
# Set up git
RUN apk add git
ADD git-config.txt ${WORKDIR}

RUN if [ -f git-config.txt ]; then cp git-config.txt ~/.gitconfig; fi

EXPOSE 7000
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test code

on:
workflow_dispatch:
pull_request:

permissions:
contents: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:

- name: Check out repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and run linter
uses: docker/build-push-action@v5
with:
context: .
file: .docker/Dockerfile
tags: test-chatbot
outputs: type=docker

- name: Run tests
env:
DOCKER_BUILDKIT: 0
run: |
docker run --rm --memory=1g \
-v ${{ github.workspace }}:/chatbot_server \
-w /chatbot_server \
test-chatbot \
sh -c "pnpm install --frozen-lockfile && pnpm test"
Loading