Skip to content

Commit

Permalink
another approach to getting ci working
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxHarmonium committed Oct 11, 2024
1 parent 086330a commit b64ff2c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-bullseye
FROM python:3.12-bullseye AS python_base

ENV PYTHONUNBUFFERED 1

Expand All @@ -14,3 +14,13 @@ RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.cargo/bin/:$PATH"

FROM python_base AS python_e2e

ENV UV_PROJECT_ENVIRONMENT=/root/.cache/uv

WORKDIR /usr/src/app

COPY . .

RUN uv sync --all-extras
6 changes: 6 additions & 0 deletions .devcontainer/docker-compose.e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
app:
build:
context: ..
target: python_e2e
command: uv run fastapi dev ./openday_scavenger/main.py
1 change: 1 addition & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
app:
build:
context: ..
target: python_base
dockerfile: .devcontainer/Dockerfile

# It is important not to include the project virtual environment (.venv) in the mount,
Expand Down
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
node_modules
9 changes: 5 additions & 4 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Start Server
uses: devcontainers/[email protected]
with:
runCmd: uv sync --all-extras && nohup bash -c 'uv run fastapi dev ./openday_scavenger/main.py'
- name: Run docker-compose
working-directory: ./.devcontainer
run: |
docker compose -f docker-compose.yml -f docker-compose.e2e.yml build
docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d
- name: Cypress run
uses: cypress-io/github-action@v6
Expand Down
14 changes: 14 additions & 0 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@devcontainers/cli": "^0.71.0",
"@eslint/js": "^9.12.0",
"@types/cypress": "^0.1.6",
"cypress": "^13.15.0",
Expand Down

0 comments on commit b64ff2c

Please sign in to comment.