Skip to content

Commit

Permalink
updates CI
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Oct 18, 2024
1 parent 825100e commit 3dd1b46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ jobs:
-v "./tests:/app/tests" \
-v "./pytest.ini:/app/pytest.ini" \
-t "unicef/hope-country-workspace:${{env.BRANCH}}-test-${{env.checksum}}" \
pytest -c /app/pytest.ini tests/ -v --maxfail=5 --migrations --cov --cov-report xml:/app/coverage.xml
pytest -c /app/pytest.ini tests/ -v --maxfail=5 --migrations --cov --cov-report xml:output/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
continue-on-error: true
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
files: /output/coverage.xml
files: /app/output/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: false
name: codecov-${{env.GITHUB_REF_NAME}}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Lint](https://github.com/unicef/hope-country-workspace/actions/workflows/lint.yml/badge.svg)](https://github.com/unicef/hope-country-workspace/actions/workflows/lint.yml)
[![codecov](https://codecov.io/github/unicef/hope-country-workspace/graph/badge.svg?token=FBUB7HML5S)](https://codecov.io/github/unicef/hope-country-workspace)
[![Documentation](https://github.com/unicef/hope-country-workspace/actions/workflows/docs.yml/badge.svg)](https://unicef.github.io/hope-country-workspace/)
[![Docker Pulls](https://img.shields.io/docker/pulls/unicef/hope-country-workspace)](https://hub.docker.com/repository/docker/unicef/hope-country-workspace/tags)


## Spreadsheet import
Expand Down
16 changes: 12 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ RUN set -x \
RUN pip install uv

COPY pyproject.toml uv.lock AUTHORS LICENSE README.md MANIFEST.in /app/
#COPY src /app/src

WORKDIR /app
RUN uv sync --no-dev --no-editable --frozen
Expand All @@ -57,9 +56,17 @@ ENV PATH=/app/.venv/bin:/usr/local/bin/:/usr/bin:/bin \
WORKDIR /app
RUN uv sync --no-editable --frozen \
&& rm -fr build hope_country_workspace.egg-info
#COPY pytest.ini /app/
#COPY tests /app/tests

# ------- package -------
FROM builder AS package
ENV PATH=/app/.venv/bin:/usr/local/bin/:/usr/bin:/bin \
DJANGO_SETTINGS_MODULE=country_workspace.config.settings \
PYTHONPATH=""\
UWSGI_PROCESSES=4
WORKDIR /app
COPY src/ /app/src/
COPY pyproject.toml uv.lock AUTHORS LICENSE README.md MANIFEST.in /app/
RUN uv sync --no-dev --no-editable --frozen

# ------- dist -------
FROM python_base AS dist
Expand All @@ -68,9 +75,10 @@ ENV PATH=/app/.venv/bin:/usr/local/bin/:/usr/bin:/bin \
PYTHONPATH=""\
UWSGI_PROCESSES=4

WORKDIR /app
COPY docker/conf /conf/
COPY docker/bin/* /usr/local/bin/
COPY --chown=user:app --from=builder /app/.venv /app/.venv
COPY --chown=user:app --from=package /app/.venv /app/.venv

EXPOSE 8000
ENTRYPOINT exec docker-entrypoint.sh "$0" "$@"
Expand Down

0 comments on commit 3dd1b46

Please sign in to comment.