mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-14 09:40:39 +08:00
Merge pull request #194 from Codium-ai/ok/test_action
Implementing GitHub Actions Workflow for Build and Test
This commit is contained in:
36
.github/workflows/build-and-test.yaml
vendored
Normal file
36
.github/workflows/build-and-test.yaml
vendored
Normal file
@ -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
|
||||||
|
|
||||||
|
|
@ -4,17 +4,21 @@ WORKDIR /app
|
|||||||
ADD pyproject.toml .
|
ADD pyproject.toml .
|
||||||
RUN pip install . && rm pyproject.toml
|
RUN pip install . && rm pyproject.toml
|
||||||
ENV PYTHONPATH=/app
|
ENV PYTHONPATH=/app
|
||||||
ADD pr_agent pr_agent
|
|
||||||
|
|
||||||
FROM base as github_app
|
FROM base as github_app
|
||||||
|
ADD pr_agent pr_agent
|
||||||
CMD ["python", "pr_agent/servers/github_app.py"]
|
CMD ["python", "pr_agent/servers/github_app.py"]
|
||||||
|
|
||||||
FROM base as github_polling
|
FROM base as github_polling
|
||||||
|
ADD pr_agent pr_agent
|
||||||
CMD ["python", "pr_agent/servers/github_polling.py"]
|
CMD ["python", "pr_agent/servers/github_polling.py"]
|
||||||
|
|
||||||
FROM base as test
|
FROM base as test
|
||||||
ADD requirements-dev.txt .
|
ADD requirements-dev.txt .
|
||||||
RUN pip install -r requirements-dev.txt && rm 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
|
FROM base as cli
|
||||||
|
ADD pr_agent pr_agent
|
||||||
ENTRYPOINT ["python", "pr_agent/cli.py"]
|
ENTRYPOINT ["python", "pr_agent/cli.py"]
|
||||||
|
Reference in New Issue
Block a user