Skip to content

Commit

Permalink
run tests in container (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
kd7lxl authored Dec 31, 2022
1 parent bfda77b commit 8ecd776
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Container Image
run: docker build --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t hamwan-portal .
- name: Run Tests
run: |
python manage.py test
docker run --rm hamwan-portal manage.py test
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# syntax=docker/dockerfile:1.4
ARG PYTHON_VERSION=2.7
FROM python:$PYTHON_VERSION
EXPOSE 8000
WORKDIR /app
COPY requirements.txt /app
RUN pip install -r requirements.txt --no-cache-dir
COPY . /app
ENTRYPOINT ["python"]
CMD ["manage.py", "runserver", "0.0.0.0:8000"]

0 comments on commit 8ecd776

Please sign in to comment.