Skip to content

Commit

Permalink
Merge pull request Codium-ai#194 from Codium-ai/ok/test_action
Browse files Browse the repository at this point in the history
Implementing GitHub Actions Workflow for Build and Test
  • Loading branch information
okotek committed Aug 10, 2023
2 parents 2e13b12 + 20bbdac commit fcc208d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build-and-test

on:
push:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- id: checkout
uses: actions/checkout@v2

- id: dockerx
name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- id: build
name: Build dev docker
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: false
load: true
tags: codiumai/pr-agent:test
cache-from: type=gha,scope=dev
cache-to: type=gha,mode=max,scope=dev
target: test

- id: test
name: Test dev docker
run: |
docker run --rm codiumai/pr-agent:test pytest -v
6 changes: 5 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ WORKDIR /app
ADD pyproject.toml .
RUN pip install . && rm pyproject.toml
ENV PYTHONPATH=/app
ADD pr_agent pr_agent

FROM base as github_app
ADD pr_agent pr_agent
CMD ["python", "pr_agent/servers/github_app.py"]

FROM base as github_polling
ADD pr_agent pr_agent
CMD ["python", "pr_agent/servers/github_polling.py"]

FROM base as test
ADD requirements-dev.txt .
RUN pip install -r requirements-dev.txt && rm requirements-dev.txt
ADD pr_agent pr_agent
ADD tests tests

FROM base as cli
ADD pr_agent pr_agent
ENTRYPOINT ["python", "pr_agent/cli.py"]

0 comments on commit fcc208d

Please sign in to comment.